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

npx 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 to a hosting provider

npm install -g vercel npx docslit build cd dist vercel --prod Alternatively, connect your git repository to Vercel and set the build command to npx docslit build with the output directory set to dist. npm install -g netlify-cli npx docslit build netlify deploy --prod --dir=dist For continuous deployment, connect your repository and set the build command to npx 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: 24 - run: npx 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.
npx 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:

File Purpose
index.html App shell with navigation and components
docs/*.html Pre-rendered pages for SEO
docs/*.md Raw Markdown for programmatic access
search-index.json Client-side full-text search
sitemap.xml Search engine sitemap
robots.txt Crawler directives
llms.txt AI agent discovery index
llms-full.txt Complete docs as plain text

Custom output directory

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

npx docslit build --out public