docs: change configurations to make v2 the main docs (#9729)
* docs: change configurations to make v2 the main docs * move api routes to top level * remove api prefix * update opengraph images * show v1 link * add redirect to v1
This commit is contained in:
1 parent
471f7e4a10
commit
88f2d17a24
40 files changed
+115
-128
No files matched your search
@@ -201,4 +201,4 @@ export default MyCustom
|
||||
|
||||
## Properties Reference
|
||||
|
||||
Refer to the [Data Model API reference](https://docs.medusajs.com/v2/resources/references/data-model) for a full reference of the properties.
|
||||
Refer to the [Data Model API reference](!resources!/references/data-model) for a full reference of the properties.
|
||||
@@ -14,7 +14,7 @@ This chapter covers how to extend the Create Product API route to link a product
|
||||
|
||||
## Additional Data in API Routes
|
||||
|
||||
Some API routes, including the [Create Product API route](https://docs.medusajs.com/v2/api/admin#products_postproducts), accept an `additional_data` request body parameter.
|
||||
Some API routes, including the [Create Product API route](!api!/admin#products_postproducts), accept an `additional_data` request body parameter.
|
||||
|
||||
It's useful when you want to pass custom data, such as the brand ID, then perform an action based on this data, such as link the brand to the product.
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ In this chapter, you’ll learn how to install and use the Next.js Starter store
|
||||
},
|
||||
]} />
|
||||
|
||||
1. Clone the `v2` branch of the [Next.js Starter](https://github.com/medusajs/nextjs-starter-medusa/tree/v2):
|
||||
1. Clone the `v2` branch of the [Next.js Starter](https://github.com/medusajs/nextjs-starter-medusa):
|
||||
|
||||
```bash
|
||||
git clone https://github.com/medusajs/nextjs-starter-medusa -b v2 my-medusa-storefront
|
||||
git clone https://github.com/medusajs/nextjs-starter-medusa my-medusa-storefront
|
||||
```
|
||||
|
||||
2. Change to the `my-medusa-storefront` directory, install the dependencies, and rename the template environment variable:
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 161 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 161 KiB |
@@ -15,7 +15,7 @@ const HomepageLinksSection = () => {
|
||||
text: "Build a Module",
|
||||
},
|
||||
{
|
||||
href: "https://docs.medusajs.com/v2/resources/integrations",
|
||||
href: "https://docs.medusajs.com/resources/integrations",
|
||||
text: "Browse third-party integrations",
|
||||
},
|
||||
],
|
||||
@@ -41,11 +41,11 @@ const HomepageLinksSection = () => {
|
||||
title: "Storefront Development",
|
||||
links: [
|
||||
{
|
||||
href: "https://docs.medusajs.com/v2/resources/nextjs-starter",
|
||||
href: "https://docs.medusajs.com/resources/nextjs-starter",
|
||||
text: "Explore our storefront starter",
|
||||
},
|
||||
{
|
||||
href: "https://docs.medusajs.com/v2/resources/storefront-development",
|
||||
href: "https://docs.medusajs.com/resources/storefront-development",
|
||||
text: "Build a custom storefront",
|
||||
},
|
||||
{
|
||||
|
||||
@@ -17,28 +17,28 @@ const HomepageRecipesSection = () => {
|
||||
type: "large",
|
||||
title: "Marketplace",
|
||||
text: "Build a marketplace with multiple vendors",
|
||||
href: "https://docs.medusajs.com/v2/resources/recipes/marketplace/examples/vendors",
|
||||
href: "https://docs.medusajs.com/resources/recipes/marketplace/examples/vendors",
|
||||
icon: ShopIcon,
|
||||
},
|
||||
{
|
||||
type: "large",
|
||||
title: "Subscriptions",
|
||||
text: "Implement a subscription-based commerce store.",
|
||||
href: "https://docs.medusajs.com/v2/resources/recipes/subscriptions/examples/standard",
|
||||
href: "https://docs.medusajs.com/resources/recipes/subscriptions/examples/standard",
|
||||
icon: CalendarRefreshIcon,
|
||||
},
|
||||
{
|
||||
type: "large",
|
||||
title: "Restaurant-Delivery",
|
||||
text: "Build a restaurant marketplace inspired by UberEats, with real-time delivery handling",
|
||||
href: "https://docs.medusajs.com/v2/resources/recipes/marketplace/examples/restaurant-delivery",
|
||||
href: "https://docs.medusajs.com/resources/recipes/marketplace/examples/restaurant-delivery",
|
||||
icon: ChefHatIcon,
|
||||
},
|
||||
{
|
||||
type: "large",
|
||||
title: "Digital Products",
|
||||
text: "Sell digital products with custom fulfillment.",
|
||||
href: "https://docs.medusajs.com/v2/resources/recipes/digital-products/examples/standard",
|
||||
href: "https://docs.medusajs.com/resources/recipes/digital-products/examples/standard",
|
||||
icon: ImageBinaryIcon,
|
||||
},
|
||||
]
|
||||
@@ -63,7 +63,7 @@ const HomepageRecipesSection = () => {
|
||||
</span>
|
||||
</div>
|
||||
<Link
|
||||
href={"https://docs.medusajs.com/v2/resources/recipes"}
|
||||
href={"https://docs.medusajs.com/resources/recipes"}
|
||||
className="flex gap-0.25 items-center text-compact-small-plus"
|
||||
withIcon
|
||||
>
|
||||
|
||||
@@ -21,11 +21,11 @@ const withMDX = mdx({
|
||||
projectUrls: {
|
||||
resources: {
|
||||
url: process.env.NEXT_PUBLIC_RESOURCES_URL,
|
||||
path: "v2/resources",
|
||||
path: "resources",
|
||||
},
|
||||
"user-guide": {
|
||||
url: process.env.NEXT_PUBLIC_RESOURCES_URL,
|
||||
path: "v2/user-guide",
|
||||
path: "user-guide",
|
||||
},
|
||||
ui: {
|
||||
url: process.env.NEXT_PUBLIC_RESOURCES_URL,
|
||||
@@ -33,7 +33,7 @@ const withMDX = mdx({
|
||||
},
|
||||
api: {
|
||||
url: process.env.NEXT_PUBLIC_RESOURCES_URL,
|
||||
path: "v2/api",
|
||||
path: "api",
|
||||
},
|
||||
},
|
||||
useBaseUrl:
|
||||
@@ -81,29 +81,49 @@ const nextConfig = {
|
||||
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
|
||||
|
||||
transpilePackages: ["docs-ui"],
|
||||
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2",
|
||||
async rewrites() {
|
||||
return {
|
||||
fallback: [
|
||||
{
|
||||
source: "/v2/resources",
|
||||
source: "/resources",
|
||||
destination: `${
|
||||
process.env.NEXT_PUBLIC_RESOURCES_URL || "https://localhost:3001"
|
||||
}/v2/resources`,
|
||||
}/resources`,
|
||||
basePath: false,
|
||||
},
|
||||
{
|
||||
source: "/v2/resources/:path*",
|
||||
source: "/resources/:path*",
|
||||
destination: `${
|
||||
process.env.NEXT_PUBLIC_RESOURCES_URL || "https://localhost:3001"
|
||||
}/v2/resources/:path*`,
|
||||
}/resources/:path*`,
|
||||
basePath: false,
|
||||
},
|
||||
{
|
||||
source: "/v2/api/:path*",
|
||||
source: "/api",
|
||||
destination: `${
|
||||
process.env.NEXT_PUBLIC_API_URL || "https://localhost:3001"
|
||||
}/v2/api/:path*`,
|
||||
}/api`,
|
||||
basePath: false,
|
||||
},
|
||||
{
|
||||
source: "/api/:path*",
|
||||
destination: `${
|
||||
process.env.NEXT_PUBLIC_API_URL || "https://localhost:3001"
|
||||
}/api/:path*`,
|
||||
basePath: false,
|
||||
},
|
||||
{
|
||||
source: "/v1",
|
||||
destination: `${
|
||||
process.env.NEXT_PUBLIC_DOCS_V1_URL || "https://localhost:3001"
|
||||
}/v1`,
|
||||
basePath: false,
|
||||
},
|
||||
{
|
||||
source: "/v1/:path*",
|
||||
destination: `${
|
||||
process.env.NEXT_PUBLIC_DOCS_V1_URL || "https://localhost:3001"
|
||||
}/v1/:path*`,
|
||||
basePath: false,
|
||||
},
|
||||
// TODO comment out once we have the user guide published
|
||||
@@ -123,48 +143,8 @@ const nextConfig = {
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
source: "/advanced-development/:path*",
|
||||
destination: "/learn/advanced-development/:path*",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/basics/:path*",
|
||||
destination: "/learn/basics/:path*",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/customization/:path*",
|
||||
destination: "/learn/customization/:path*",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/debugging-and-testing/:path*",
|
||||
destination: "/learn/debugging-and-testing/:path*",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/deployment/:path*",
|
||||
destination: "/learn/deployment/:path*",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/first-customizations/:path*",
|
||||
destination: "/learn/first-customizations/:path*",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/more-resources/:path*",
|
||||
destination: "/learn/more-resources/:path*",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/storefront-development/:path*",
|
||||
destination: "/learn/storefront-development/:path*",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/more-resources/examples",
|
||||
destination: "/resources/examples",
|
||||
source: "/v2/:path*",
|
||||
destination: "/:path*",
|
||||
permanent: true,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -48,7 +48,7 @@ const SearchProvider = ({ children }: SearchProviderProps) => {
|
||||
},
|
||||
],
|
||||
checkInternalPattern: new RegExp(
|
||||
`^${config.baseUrl}/v2/([^(resources)])*`
|
||||
`^${config.baseUrl}/([^(resources)])*`
|
||||
),
|
||||
filterOptions: searchFilters,
|
||||
}}
|
||||
|
||||
@@ -32,8 +32,8 @@ module.exports = {
|
||||
"search-no-result-dark": "url('/images/search-no-result.svg')",
|
||||
"magnifying-glass": "url('/images/magnifying-glass.svg')",
|
||||
"magnifying-glass-dark": "url('/images/magnifying-glass-dark.svg')",
|
||||
"bg-stripes": "url('/v2/images/bg-stripes.png')",
|
||||
"bg-stripes-dark": "url('/v2/images/bg-stripes-dark.png')",
|
||||
"bg-stripes": "url('/images/bg-stripes.png')",
|
||||
"bg-stripes-dark": "url('/images/bg-stripes-dark.png')",
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user