DocgoDocgo
Latest
/Advanced

Deployment

Build and deploy Docgo's static output to any static host.

Docgo builds a static site into outDir, which defaults to dist.

npx docgo build

Deploy the contents of dist to any static hosting provider.

Production checklist

Before deploying:

  • Set siteUrl to the public docs URL.
  • Set baseUrl if the site is hosted under a sub-path.
  • Replace public/favicon.png and public/logo.png.
  • Add a real social preview image such as public/og.png.
  • Confirm seo.sitemap, seo.robots, and seo.llmsTxt are configured.
  • Run npx docgo build.

Root hosting

For a site hosted at the domain root:

docgo.config.mjs
export default defineConfig({
  baseUrl: '/',
  siteUrl: 'https://docs.example.com',
});

Sub-path hosting

For a site hosted at https://example.com/docs/:

docgo.config.mjs
export default defineConfig({
  baseUrl: '/docs/',
  siteUrl: 'https://example.com/docs/',
});

Docgo prefixes generated asset and internal navigation URLs with /docs/.

Static host output

A typical output looks like this:

dist/
  index.html
  guide/
    getting-started/
      index.html
  guide/getting-started.md
  assets/
    client-*.js
    search-index/
      en/
        latest.json
    docgo.css
    bmates-ui.css
  sitemap.xml
  robots.txt
  llms.txt
  favicon.png
  logo.png

Clean URLs

Docgo writes routes as directories with index.html.

/guide/getting-started -> dist/guide/getting-started/index.html

Your host should serve directory index.html files for clean URLs. Most static hosts do this by default.

Client navigation

The first load is static HTML. The client bundle hydrates interactive controls such as search, dropdowns, sidebars, code groups, page actions, and theme toggling.

CI command

Use the build command in CI:

npm ci
npm run build

If your project uses the package scripts generated by Docgo's own repository, the build script runs:

tsx ./bin/docgo.ts build

For an installed package, use docgo build or npx docgo build.

Edit this page

Last updated: