Skip to content

Commit 0ce5c1b

Browse files
Kludexsamuelcolvin
andauthored
use hyphen in docs (#1245)
Co-authored-by: Samuel Colvin <[email protected]>
1 parent a60f0e1 commit 0ce5c1b

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

docs-site/src/index.ts

Lines changed: 14 additions & 1 deletion
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)
8-
return new Response(r.body, { status: 404 })
13+
return new Response(r.body, { status: 404, headers: {'content-type': 'text/html'} })
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.replace(/\/+$/, '')] ?? null
25+
}

docs-site/wrangler.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#:schema node_modules/wrangler/config-schema.json
22
name = "pydantic-ai"
3-
compatibility_date = "2025-01-29"
3+
compatibility_date = "2025-01-24"
44
routes = ["ai.pydantic.dev/*"]
55
main = "src/index.ts"
66
workers_dev = false
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)