docs: add routing page (#9550)

- Add a new homepage to `book` project for the routing page
- Move all main doc pages to be under `/v2/learn` (and added redirects + fixed links across docs)
- Other: add admin components to resources dropdown + fixes to search on mobile.

Closes DX-955

Preview: https://docs-v2-git-docs-router-page-medusajs.vercel.app/v2
This commit is contained in:
Shahed Nasser
2024-10-18 08:24:34 +00:00
committed by GitHub
parent 7a47f5211d
commit 0a37675f0e
223 changed files with 2549 additions and 696 deletions
@@ -0,0 +1,95 @@
import clsx from "clsx"
import { Link } from "docs-ui"
const HomepageLinksSection = () => {
const sections: SectionProps[] = [
{
title: "Customize Medusa Application",
links: [
{
href: "/learn",
text: "Create your first application",
},
{
href: "/learn/customization",
text: "Build a Module",
},
{
href: "https://docs.medusajs.com/v2/resources/integrations",
text: "Browse third-party integrations",
},
],
},
{
title: "Admin Development",
links: [
{
href: "/learn/basics/admin-customizations",
text: "Build a UI Widget",
},
{
href: "/learn/advanced-development/admin/ui-routes",
text: "Add a UI Route",
},
{
href: "https://docs.medusajs.com/ui",
text: "Browse the UI component library",
},
],
},
{
title: "Storefront Development",
links: [
{
href: "https://docs.medusajs.com/v2/resources/nextjs-starter",
text: "Explore our storefront starter",
},
{
href: "https://docs.medusajs.com/v2/resources/storefront-development",
text: "Build a custom storefront",
},
{
href: "https://docs.medusajs.com/ui",
text: "Browse the UI component library",
},
],
},
]
return (
<div
className={clsx(
"hidden lg:block py-4 w-full",
"border-y border-medusa-border-base xl:mx-auto"
)}
>
<div className="flex gap-4 flex-wrap xl:mx-auto xl:max-w-[1136px] w-full px-4 xl:px-0">
{sections.map((section, index) => (
<Section {...section} key={index} />
))}
</div>
</div>
)
}
type SectionProps = {
title: string
links: {
text: string
href: string
}[]
}
const Section = ({ title, links }: SectionProps) => {
return (
<div className="flex flex-col gap-0.5 flex-1">
<h3 className="text-h3 text-medusa-fg-base">{title}</h3>
{links.map((link, index) => (
<Link key={index} className="text-compact-small-plus" href={link.href}>
{link.text}
</Link>
))}
</div>
)
}
export default HomepageLinksSection