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 = {
|
||||
|
||||
+10721
-10721
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user