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"
|
||||
|
||||
export function middleware(request: NextRequest) {
|
||||
return NextResponse.rewrite(
|
||||
new URL(
|
||||
`/md-content${request.nextUrl.pathname.replace("/index.html.md", "")}`,
|
||||
request.url
|
||||
const path = request.nextUrl.pathname.replace("/index.html.md", "")
|
||||
if (
|
||||
!path.startsWith("/resources") &&
|
||||
!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 = {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,9 @@ export const changeLinksToHtmlMdPlugin = (): Transformer => {
|
||||
if (
|
||||
node.type === "link" &&
|
||||
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`
|
||||
}
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
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 "./product-collection.js"
|
||||
export * from "./product-category.js"
|
||||
export * from "./publishable-api-key.js"
|
||||
export * from "./query.js"
|
||||
export * from "./server.js"
|
||||
export * from "./sales-channel.js"
|
||||
export * from "./tax.js"
|
||||
export * from "./cart.js"
|
||||
export * from "./region.js"
|
||||
export * from "./api-key.js"
|
||||
export * from "./storefront.js"
|
||||
export * from "./order.js"
|
||||
export * from "./payment.js"
|
||||
export * from "./product.js"
|
||||
export * from "./customer.js"
|
||||
export * from "./remote-query.js"
|
||||
export * from "./link.js"
|
||||
export * from "./product-category.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 "./store.js"
|
||||
export * from "./promotion.js"
|
||||
export * from "./workflow.js"
|
||||
export * from "./product-collection.js"
|
||||
export * from "./link.js"
|
||||
export * from "./auth.js"
|
||||
export * from "./event-bus.js"
|
||||
export * from "./js-sdk.js"
|
||||
export * from "./notification.js"
|
||||
export * from "./stock-location.js"
|
||||
export * from "./workflow.js"
|
||||
export * from "./pricing.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 "./currency.js"
|
||||
export * from "./file.js"
|
||||
export * from "./notification.js"
|
||||
export * from "./js-sdk.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