Project structure

Getting started•3 min read|
|

Every DocsLit project follows a simple, flat structure. There are no deeply nested configuration directories or framework-specific folders.

Directory layout

Key files and directories

Project configuration. Defines your site name, sidebar navigation, and optional versioning. It is optional: without it, DocsLit uses the folder name as the site name and an automatic sidebar. Contains all your Markdown documentation pages. Each .md file becomes a page on your site. The filename (without extension) is the page slug used in URLs. Reusable markdown fragments for <wc-include />. Include targets must live under this directory. Optional directory for custom Lit web components. Any .js file here is automatically loaded alongside the built-in components. Generated output directory. Created when you run docslit build. Deploy this directory to any static hosting provider.

Projects without a config file

A project needs only a docs/ folder of .md files. build, dev, validate, lint and mcp run without docslit.json, using an automatic sidebar (the same as "sidebar": "auto") and the folder name as the site name. Commands that write config, such as docslit new and docslit theme use, need a real docslit.json. Without a docs/ folder, the error tells you that a docs/ folder also works. Run docslit init for a project with a config file.

Configuration file

The docslit.json file controls your site's name, description, and sidebar navigation:

{ "name": "My Docs", "description": "Documentation for my product", "sidebar": [ { "group": "Getting started", "pages": ["introduction", "installation", "quickstart"] }, { "group": "Guides", "pages": ["authentication", "deployment"] } ] } The site title displayed in the header and browser tab. A short description of your documentation site. Used in llms.txt for AI discovery. The base URL where your docs are hosted. Used to generate absolute links in sitemap.xml and llms.txt. An array of groups, each containing a group name and a pages array of page slugs. The order defines the sidebar navigation and pagination. Multi-version configuration. See versioning for details. Path to a custom logo image for the navigation bar. See logo. Site-wide announcement banner with a message string and optional type and dismissible fields. See announcement banner. A theme (peppermint, frond, tonal, folio, ledger or default), a palette name (e.g. ocean), a path to a brand theme JSON file (e.g. ./brand-theme.json), or an inline theme object with name, palette, colors, fonts, radius, appearance and strict. See Themes. Path to an OpenAPI 3.x spec file, or an object with spec and overlay keys. Enables spec-driven API reference generation. See OpenAPI integration for details. Python API reference settings: packages (package names, with data in api/python/<name>.json), docstringStyle (google, numpy or sphinx) and options (default options for ::: directives). See Python API reference. Set to true to generate an Open Graph image for every page at build time. Off by default. Pages keep their og:title and og:description tags either way. A page can opt out with ogImage: false in its frontmatter. Build switches, equivalent to the `docslit build` flags. `ogImages` (default `false`) turns OG images on. `searchIndex`, `llmsTxt`, `mcp` and `sitemap` (default `true`) turn a generator off when `false`. `cache` (default `false`) enables incremental builds. See [Commands](../cli-reference/commands#faster-builds). { "build": { "ogImages": true, "searchIndex": true, "llmsTxt": true, "mcp": true, "sitemap": true, "cache": true } }

Page slugs

Page slugs are the filenames without the .md extension. They determine the URL path for each page.

File path Slug URL
docs/introduction.md introduction /introduction
docs/getting-started.md getting-started /getting-started
docs/api-reference.md api-reference /api-reference
Use lowercase kebab-case for file names. DocsLit automatically converts slugs to title case in the sidebar — getting-started displays as "Getting Started".

Build output

When you run docslit build, the dist/ directory contains:

Redirects to the first page in the sidebar and carries a canonical link to it. Pre-rendered HTML pages for each documentation page. These are crawlable by search engines. Raw Markdown source files. Available for programmatic consumption by other tools. Full-text search index built at compile time. Powers the client-side search with no external service. XML sitemap for search engine crawlers. Generated when url is set in your configuration. LLM-friendly site index following the llmstxt.org specification. Lists all pages with descriptions. Complete documentation corpus as plain text. AI agents can consume your entire docs in one request. The Lit runtime the components use, copied from the DocsLit package. Pages load it from here, so the site makes no CDN request for Lit and always runs the Lit version DocsLit was tested with. Allows all major search engines and AI crawlers by default and points them at sitemap.xml.

Next steps