Static hosting

Deployment4 min read|
|

DocsLit builds a standard static site that you can deploy to any hosting provider. Run docslit build and upload the dist/ directory.

Build your site

docslit build

This generates a dist/ directory with HTML pages, a search index, sitemap, and AI discovery files.

Add `"url": "https://docs.example.com"` to your `docslit.json` before building. This enables absolute URLs in your sitemap and `llms.txt`.

Deploy recipes

Generate host-specific config files from the CLI:

docslit deploy --github-pages docslit deploy --netlify docslit deploy --cloudflare

For GitHub project sites (https://user.github.io/repo/), set "basePath": "/repo" in docslit.json so asset and navigation URLs stay correct.

Deploy to a hosting provider

npm install -g vercel docslit build cd dist vercel --prod

Alternatively, connect your git repository to Vercel and set the build command to docslit build with the output directory set to dist.

npm install -g netlify-cli docslit build netlify deploy --prod --dir=dist

For continuous deployment, connect your repository and set the build command to docslit build with the publish directory set to dist.

Create .github/workflows/deploy.yml:

name: Deploy docs on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest permissions: pages: write id-token: write steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - run: npm install -g docslit - run: docslit build - uses: actions/upload-pages-artifact@v3 with: path: dist - uses: actions/deploy-pages@v4

Go to your repository Settings > Pages and set the source to GitHub Actions.

docslit build aws s3 sync dist/ s3://your-bucket-name --delete

Enable static website hosting on your S3 bucket and set index.html as the index document. Optionally, put CloudFront in front for HTTPS and caching.

What gets deployed

Every build produces these files:

FilePurpose
index.htmlApp shell with navigation and components
docs/*.htmlPre-rendered pages for SEO
docs/*.mdRaw Markdown for programmatic access
search-index.jsonClient-side full-text search
sitemap.xmlSearch engine sitemap
robots.txtCrawler directives
llms.txtAI agent discovery index
llms-full.txtComplete docs as plain text
_middleware.jsContent negotiation for AI agents (Cloudflare/Netlify)
vercel.jsonContent negotiation for AI agents (Vercel)
.well-known/agent.jsonMachine-readable agent discovery
mcp-server.jsMCP server for AI tool integration
pdf/Chapter, page, and full documentation PDFs (when built with --pdf)
Run docslit build --pdf to generate downloadable PDF manuals alongside your HTML site. See Chapter PDF export.

Custom output directory

Use the --out flag to change the output directory:

docslit build --out public