Skip to content

Commit

Permalink
docs: fix some index.html.md links resulting 404
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser committed Feb 10, 2025
1 parent 702d338 commit 2f1faba
Show file tree
Hide file tree
Showing 4 changed files with 15,838 additions and 15,831 deletions.
15 changes: 10 additions & 5 deletions www/apps/book/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Loading

0 comments on commit 2f1faba

Please sign in to comment.