Base Path & Subpaths
Serve your docs at /docs, a custom prefix, or the deployment root — and host the build under a subpath such as a GitHub Pages project site.
Flame always emits a flat .html build, but the URL shape it is served under is configurable. Two independent settings decide that shape, and mixing them up is the usual cause of broken assets after a move:
flowchart TD
U["https://acme.github.io/handbook/docs/guide/routing.html"]
O["Origin — https://acme.github.io"]
R["Deployment root — /handbook, from the meta.baseURL pathname"]
P["Docs prefix — /docs, from meta.basePath"]
F["Page — docs/guide/routing.mdx"]
U --> O
O --> R
R --> P
P --> F
Docs prefix
meta.basePath is where the docs site sits inside the dist and in the URL. It defaults to /docs, so leaving it unset keeps the historical layout:
The prefix is applied everywhere a docs URL is produced — the dev server and static routing, internal links and asset paths in rendered pages, canonical and Open Graph URLs, the search index, and the nginx config generated by flame deploy --docker. It is also part of the build cache key, so changing it rebuilds every page instead of reusing HTML that points at the old prefix.
You do not have to rewrite your content when you change it: links authored as /docs/guide/routing are re-based onto the configured prefix, so one docu.json works at /docs, at /handbook, and at the deployment root. See Formatting for the link rules.
Deployment root
meta.baseURL is the origin plus the deployment root — the base a browser prepends to every root-absolute path. Its pathname is the deployment path: empty when the origin serves the dist at /, /repo when the host publishes the artifact under a path.
Flame prepends it to every root-absolute URL that points into the build: sidebar, navbar and pagination links, the logo, the landing page link, the 404.html fallback's bundle assets and the search index records. It is also the base canonical and Open Graph URLs are resolved against. Page stylesheets and scripts are linked relatively, so they line up on their own. The dev server always serves from the origin root and leaves the deployment path out.
Common setups
For a project site, baseURL must include the repository segment — that is the path GitHub Pages serves the artifact under. Without it, the search index and the 404 fallback point at the origin root and return 404.
Root deployment
Setting "basePath": "" serves the docs at the deployment root. Two details follow from that:
- Pages move to the dist root.
docs/getting-started.mdx→.docu/dist/getting-started.html, and the URL is/getting-started.htmlunder the deployment root. - The landing page owns
/. The docs index (docs/index.mdx) is not written — it would collide with the generated landing page — andindex.htmlleft over from a previous build is removed. Author links as usual:/docs/guide/routingcollapses to/guide/routing.
The docs index is optional in every setup: when docs/index.mdx (or docs/index.md) is absent, the build simply produces no docs index page — the landing page always owns /. The exception is a project that brings its own pages: there is no generated landing page then, so at the root the docs index takes /.
Bring your own pages
For application setup, local development and hosting recipes, start with Bring Your Own Pages. It includes project layouts and monorepos, separate framework guides, and deployment instructions for Vercel, Cloudflare, Heroku and Netlify. This section describes the underlying path and output behavior.
By default Flame also generates the landing page at / (from home in docu.json). A project that already has its own site — a React app at the repository root, or anything else that serves the same origin — can switch it off and keep everything Flame builds under the docs prefix:
With the flag on, the build owns nothing outside meta.basePath:
- No landing page.
index.htmlis not written at the dist root, and no landing bundle is built.homeis ignored, and the build logs a warning while the section is still present. - The 404 page stays Flame's and moves to
<basePath>/404.html, so it never replaces your app's own root 404. - Bundles move under the prefix. Hashed JS and CSS, the asset manifest and the search index are written to
<basePath>/_flame/instead of the dist-rootassets/, which Vite and most React toolchains use for their own output. - Stale output is cleaned up. Files a default build left at the dist root are removed, and turning the flag off again removes
_flame/.
With a root basePath ("" or "/") nothing else can own /, so the docs index is written to the dist root and the 404 stays at /404.html. Bundles still move to /_flame/, so they no longer share /assets/ with the content assets.
The flag is off by default, so existing projects keep byte-identical output until they opt in.
Serving the docs next to your app
Because everything sits under the prefix, one route rule for /docs/* is all a host needs. Two setups cover most platforms.
One project, merged output. A host publishes one output directory; the framework preset only picks default commands. When your app builds to static files, build both and copy the dist into the app's output — the trees do not overlap:
Two deployments, joined by a rewrite. Deploy the docs as their own site and forward the prefix from your app. This also works when the app renders on the server, as with Next.js:
The same pattern is a proxy rule (/docs/* https://acme-docs.netlify.app/docs/:splat 200) in Netlify's _redirects, or a location /docs/ block in nginx. Flame has no output-directory option: copying the dist is one explicit line in your own build, and writing into another project's tree would pick up that platform's static-file rules.
A docs-scoped 404 needs the host to know about it. nginx can point error_page at /docs/404.html inside the docs location. On Netlify, a /docs/* /docs/404.html 404 rule on the site that serves the docs files does the same, because existing files take precedence over redirect rules. Hosts that only honor a root 404.html show your app's 404 for missing docs pages.
What the commands do
Canonical form
The prefix is both a URL path and an output directory, so it is canonicalized to lowercase segments with no trailing slash, no dot segments, and nothing that needs percent-encoding. The schema describes the accepted shape:
Non-canonical values are still honored — Flame normalizes them and logs a warning naming the canonical value, so you can update docu.json and keep the editor quiet:
Two values are hard failures: a non-string, which cannot be normalized, and a whitespace-only string, which is almost certainly a typo — reading it as the root would silently move every page. Everything else is reported and normalized at the start of flame dev and flame build, before any output is written.
Verify
After a build, the prefix should show up consistently in each of these places:
Last updated Nov 7, 2026