Offline builds
DocsLit can build your entire documentation site as a self-contained folder. No server required — readers open index.html in their browser by double-clicking it. Pages load lazily for fast startup, and zero network requests are made.
Build an offline site
This produces a dist/ folder with everything needed to run offline:
index.html— the main entry point with all styles and components inlinepages/*.js— individual page content, loaded on demand as readers navigatesearch-index.js— the search index, loaded when search is first used
All navigation, search, and theme switching work without a server or internet connection.
When to use offline builds
Offline vs static builds
| Feature | Static build | Offline build |
|---|---|---|
| Output | Multiple files in dist/ | Self-contained dist/ folder |
| Server required | Yes (any static host) | No (file:// works) |
| SEO pages | Yes (docs/*.html) | No |
| Sitemap | Yes | No |
| Search | Yes | Yes |
| llms.txt | Yes | No |
| External requests | Google Fonts | None |
Security
Offline builds are hardened for safe use in restricted environments:
- No inline event handlers — all interactivity uses event delegation instead of
onclick/oninputattributes, making the output compatible with strict Content Security Policies - XSS protection — all user-facing interpolated values (page IDs, navigation text) are HTML-escaped before insertion into the DOM
- No external requests — Google Fonts and other external resources are excluded; the site makes zero network requests
- Self-contained — all styles, components, and application logic are bundled inline; only page content and the search index are loaded as separate local files