Project structure

Getting started3 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. This is the only required configuration file. 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.

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. Color preset name (e.g. ocean), path to a brand theme JSON file (e.g. ./brand-theme.json), or an inline theme object with extends, colors, dark, and light. See theming. 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.

Page slugs

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

File pathSlugURL
docs/introduction.mdintroduction/introduction
docs/getting-started.mdgetting-started/getting-started
docs/api-reference.mdapi-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:

The main entry point. Contains the app shell, navigation, and the component runtime. 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. Allows all major search engines and AI crawlers by default.

Next steps