@@ -7,6 +7,7 @@ import mdx from "@astrojs/mdx";
77import { injectMdxImports } from "./src/remark/inject-mdx-imports.mjs" ;
88import { rewriteCodeGroup } from "./src/remark/rewrite-code-group.mjs" ;
99import { rewriteAsides } from "./src/remark/rewrite-asides.mjs" ;
10+ import { prependBaseToLinks } from "./src/remark/prepend-base-to-links.mjs" ;
1011import { sidebarV1 } from "./src/sidebars/v1.mjs" ;
1112import { sidebarV2 } from "./src/sidebars/v2.mjs" ;
1213import { sidebarV3 } from "./src/sidebars/v3.mjs" ;
@@ -64,11 +65,17 @@ function snippetLoaderPlugin() {
6465
6566export default defineConfig ( {
6667 site : "https://inertiajs.com" ,
68+ base : "/docs" ,
69+ // Emit build output under dist/docs/ so the on-disk layout mirrors
70+ // the URL layout. The docs worker is mounted at /docs/* via service
71+ // binding — a request for /docs/v3/... resolves to dist/docs/v3/...
72+ // without the worker having to rewrite paths.
73+ outDir : "./dist/docs" ,
6774 // The root splash page lives in a separate repo; this build only owns
6875 // /docs/*. Redirect the bare /docs entry point to the latest version's
6976 // intro page so wandering links land somewhere useful.
7077 redirects : {
71- "/docs " : "/docs/v3/getting-started/" ,
78+ "/" : "/docs/v3/getting-started/" ,
7279 } ,
7380 markdown : {
7481 remarkPlugins : [
@@ -77,6 +84,7 @@ export default defineConfig({
7784 // need to provide bindings for the originals.
7885 rewriteCodeGroup ,
7986 rewriteAsides ,
87+ prependBaseToLinks ,
8088 [
8189 injectMdxImports ,
8290 {
@@ -104,7 +112,7 @@ export default defineConfig({
104112 // runs once per navigation.
105113 {
106114 tag : "script" ,
107- attrs : { type : "module" , src : "/framework-switcher.js" } ,
115+ attrs : { type : "module" , src : "/docs/ framework-switcher.js" } ,
108116 } ,
109117 ] ,
110118 expressiveCode : {
0 commit comments