Skip to content

Commit 96c2f74

Browse files
authored
use hyphen in docs (#1241)
1 parent 669d809 commit 96c2f74

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

docs-site/src/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,23 @@ export default {
33
const r = await env.ASSETS.fetch(request)
44
if (r.status == 404) {
55
const url = new URL(request.url)
6+
const redirectPath = redirect(url.pathname)
7+
if (redirectPath) {
8+
url.pathname = redirectPath
9+
return Response.redirect(url.toString(), 301)
10+
}
611
url.pathname = '/404.html'
712
const r = await env.ASSETS.fetch(url)
813
return new Response(r.body, { status: 404 })
914
}
1015
return r
1116
},
1217
} satisfies ExportedHandler<Env>
18+
19+
const redirect_lookup: Record<string, string> = {
20+
'/common_tools/': '/common-tools/',
21+
}
22+
23+
function redirect(pathname: string): string | null {
24+
return redirect_lookup[pathname] ?? null
25+
}
File renamed without changes.

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ nav:
2020
- models.md
2121
- dependencies.md
2222
- tools.md
23-
- common_tools.md
23+
- common-tools.md
2424
- results.md
2525
- message-history.md
2626
- testing-evals.md

0 commit comments

Comments
 (0)