Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions docs-site/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,10 @@ export default {
const r = await env.ASSETS.fetch(request)
if (r.status == 404) {
const url = new URL(request.url)
const redirectPath = redirect(url.pathname)
if (redirectPath) {
url.pathname = redirectPath
return Response.redirect(url.toString(), 301)
}
url.pathname = '/404.html'
const r = await env.ASSETS.fetch(url)
return new Response(r.body, { status: 404 })
}
return r
},
} satisfies ExportedHandler<Env>

const redirect_lookup: Record<string, string> = {
'/common_tools/': '/common-tools/',
}

function redirect(pathname: string): string | null {
return redirect_lookup[pathname] ?? null
}
File renamed without changes.
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ nav:
- models.md
- dependencies.md
- tools.md
- common-tools.md
- common_tools.md
- results.md
- message-history.md
- testing-evals.md
Expand Down