docs: fix some index.html.md links resulting 404 (#11379)
This commit is contained in:
@@ -2,12 +2,17 @@ import { NextResponse } from "next/server"
|
|||||||
import type { NextRequest } from "next/server"
|
import type { NextRequest } from "next/server"
|
||||||
|
|
||||||
export function middleware(request: NextRequest) {
|
export function middleware(request: NextRequest) {
|
||||||
return NextResponse.rewrite(
|
const path = request.nextUrl.pathname.replace("/index.html.md", "")
|
||||||
new URL(
|
if (
|
||||||
`/md-content${request.nextUrl.pathname.replace("/index.html.md", "")}`,
|
!path.startsWith("/resources") &&
|
||||||
request.url
|
!path.startsWith("/ui") &&
|
||||||
|
!path.startsWith("/api") &&
|
||||||
|
!path.startsWith("/user-guide")
|
||||||
|
) {
|
||||||
|
return NextResponse.rewrite(
|
||||||
|
new URL(`/md-content${path.replace("/index.html.md", "")}`, request.url)
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
|
|||||||
+10721
-10721
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,9 @@ export const changeLinksToHtmlMdPlugin = (): Transformer => {
|
|||||||
if (
|
if (
|
||||||
node.type === "link" &&
|
node.type === "link" &&
|
||||||
node.url?.startsWith("https://docs.medusajs.com") &&
|
node.url?.startsWith("https://docs.medusajs.com") &&
|
||||||
!node.url.endsWith("index.html.md")
|
!node.url.endsWith("index.html.md") &&
|
||||||
|
!node.url.includes("/api/store") &&
|
||||||
|
!node.url.includes("/api/admin")
|
||||||
) {
|
) {
|
||||||
node.url += `/index.html.md`
|
node.url += `/index.html.md`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +1,37 @@
|
|||||||
export * from "./inventory.js"
|
export * from "./inventory.js"
|
||||||
export * from "./pricing.js"
|
|
||||||
export * from "./server.js"
|
|
||||||
export * from "./query.js"
|
|
||||||
export * from "./tax.js"
|
|
||||||
export * from "./sales-channel.js"
|
|
||||||
export * from "./stock-location.js"
|
|
||||||
export * from "./storefront.js"
|
|
||||||
export * from "./payment.js"
|
|
||||||
export * from "./order.js"
|
|
||||||
export * from "./fulfillment.js"
|
|
||||||
export * from "./stripe.js"
|
|
||||||
export * from "./product.js"
|
|
||||||
export * from "./concept.js"
|
export * from "./concept.js"
|
||||||
export * from "./product-collection.js"
|
export * from "./query.js"
|
||||||
export * from "./product-category.js"
|
export * from "./server.js"
|
||||||
export * from "./publishable-api-key.js"
|
export * from "./sales-channel.js"
|
||||||
|
export * from "./tax.js"
|
||||||
export * from "./cart.js"
|
export * from "./cart.js"
|
||||||
export * from "./region.js"
|
export * from "./storefront.js"
|
||||||
export * from "./api-key.js"
|
export * from "./order.js"
|
||||||
|
export * from "./payment.js"
|
||||||
|
export * from "./product.js"
|
||||||
export * from "./customer.js"
|
export * from "./customer.js"
|
||||||
export * from "./remote-query.js"
|
export * from "./product-category.js"
|
||||||
export * from "./link.js"
|
export * from "./stripe.js"
|
||||||
|
export * from "./fulfillment.js"
|
||||||
|
export * from "./publishable-api-key.js"
|
||||||
|
export * from "./api-key.js"
|
||||||
|
export * from "./region.js"
|
||||||
export * from "./step.js"
|
export * from "./step.js"
|
||||||
export * from "./store.js"
|
export * from "./product-collection.js"
|
||||||
export * from "./promotion.js"
|
export * from "./link.js"
|
||||||
export * from "./workflow.js"
|
|
||||||
export * from "./auth.js"
|
export * from "./auth.js"
|
||||||
export * from "./event-bus.js"
|
export * from "./stock-location.js"
|
||||||
export * from "./js-sdk.js"
|
export * from "./workflow.js"
|
||||||
export * from "./notification.js"
|
export * from "./pricing.js"
|
||||||
export * from "./user.js"
|
export * from "./user.js"
|
||||||
|
export * from "./remote-query.js"
|
||||||
|
export * from "./event-bus.js"
|
||||||
|
export * from "./logger.js"
|
||||||
export * from "./locking.js"
|
export * from "./locking.js"
|
||||||
export * from "./currency.js"
|
export * from "./currency.js"
|
||||||
export * from "./file.js"
|
export * from "./notification.js"
|
||||||
|
export * from "./js-sdk.js"
|
||||||
export * from "./admin.js"
|
export * from "./admin.js"
|
||||||
export * from "./logger.js"
|
export * from "./store.js"
|
||||||
|
export * from "./promotion.js"
|
||||||
|
export * from "./file.js"
|
||||||
|
|||||||
Reference in New Issue
Block a user