Site chrome

Customization•6 min read|
|

Make the docs site yours without forking templates. The header, footer and page shell are configured in docslit.json. For the logo, see Logo. For top-level sections, see Tabs and anchors.

navbar.links adds entries to the header, left of the search box. Each entry has a type, and a plain link is the default:

{ "navbar": { "links": [ { "label": "Support", "href": "https://example.com/support" }, { "type": "github", "href": "https://github.com/UmbrellaDocs/docslit-cli" }, { "type": "dropdown", "label": "Resources", "links": [ { "label": "Blog", "href": "https://example.com/blog", "icon": "newspaper" }, { "label": "Community", "href": "https://example.com/community", "icon": "fa-brands fa-discord" } ] }, { "type": "outlined", "label": "Sign in", "href": "https://app.example.com/login" } ], "primary": { "type": "button", "label": "Get started", "href": "https://app.example.com/signup" } } }
Type Renders as Notes
link A text link The default. Aliases: minimal, text.
github The repository name with a star count href must be a github.com/owner/repo URL. Set "stars": false to hide the count.
discord A link with the Discord icon The label defaults to "Discord". It shows no member count.
dropdown A menu button Holds a links array of label, href and icon items. Alias: menu.
filled A solid button Aliases: button, primary. Buttons sit at the right edge, after the other links.
outlined An outlined button Alias: outline.
The text. Aliases: text, title. The destination. Aliases: value, url. Internal paths and external URLs both work, and external ones open in a new tab. An icon before the label. See Icons. An icon after the label. Pill-shaped corners, for filled and outlined buttons. The link target, such as _blank. For github entries: show the star count.

Primary button

navbar.primary is the call to action at the right edge of the header. Its type is button (a solid button, the default), outlined, or github:

{ "navbar": { "primary": { "type": "button", "label": "Dashboard", "href": "https://app.example.com" } } }

GitHub stars

A github entry shows the repository's star count. The count is fetched in the reader's browser from the public GitHub API, cached in the browser for an hour and shown only when the request works. Offline builds and blocked requests show the link without a count, so the header never waits on it.

On narrow screens the navbar links move into the navigation drawer. Dropdown items are listed as plain links there, and the star count is left out.

{ "footer": { "copyright": "© 2026 Acme Inc.", "socials": { "github": "https://github.com/acme", "x": "https://x.com/acme", "discord": "https://discord.gg/acme" }, "columns": [ { "title": "Product", "links": [{ "label": "Pricing", "href": "https://example.com/pricing" }] }, { "title": "Company", "links": [{ "label": "About", "href": "https://example.com/about" }] } ], "links": [{ "label": "Status", "href": "https://status.example.com" }] } } The copyright line in the bottom bar. Link columns above the bottom bar. Each has a title and a links array of label and href. A row of links in the bottom bar. Social icons, by platform name. The value is the profile URL.

External footer links open in a new tab. The socials keys that get their own icon and label are github, x (also twitter), discord, slack, linkedin, youtube, facebook, instagram, reddit, twitch, mastodon, bluesky, threads, telegram, whatsapp, medium, dev, hacker-news, stack-overflow, gitlab, npm, website, rss and email. Any other key is looked up as an icon name, so a Font Awesome brand name works too.

Custom CSS and head tags

{ "css": "styles/custom.css", "head": [ "<meta name=\"theme-color\" content=\"#0f172a\">" ], "favicon": "assets/favicon.png" }

css is copied into the build output and linked after the DocsLit theme stylesheet. head injects raw trusted HTML into <head>. For layout attributes, Mintlify-style hooks and ::part() selectors, see Custom CSS.

editUrl adds an "Edit this page" link to every page. When you omit it, DocsLit tries to detect it from your git remote.

Set issueUrl to add a "Report an issue" link next to it. A string is the base URL of a new-issue form. true derives it from a github.com or gitlab.com editUrl: https://github.com/<owner>/<repo>/issues/new or https://gitlab.com/<group>/<project>/-/issues/new.

{ "issueUrl": true }

The form opens with the title Docs: <page title> and a body that contains the page URL. A string issueUrl shows the link even when there's no editUrl. The default is no link.

Analytics presets

{ "analytics": { "provider": "plausible", "domain": "docs.example.com" } }

Supported providers: plausible, fathom, ga4 (uses measurementId), posthog (uses apiKey / host), and the presets in the next table.

Provider Key Notes
clarity projectId
hotjar siteId Must be numeric.
segment writeKey Calls analytics.page() on each in-site navigation.
mixpanel token Optional apiHost. The SDK tracks in-site navigation with track_pageview: 'url-with-path'.
amplitude apiKey Optional serverZone, US or EU. Page views autocapture path changes.

Each of these also accepts siteId as an alias for its key. For example, a Mixpanel project in the EU:

{ "analytics": { "provider": "mixpanel", "token": "YOUR_PROJECT_TOKEN", "apiHost": "https://api-eu.mixpanel.com" } }

For your own analytics script, listen for docslit:navigate. DocsLit fires it as a CustomEvent on document after each client-side page load, with detail.page (the page id) and detail.path (the URL path). It doesn't fire for the first page load, so record that view yourself.

document.addEventListener('docslit:navigate', (event) => { console.log('page view', event.detail.path); });

Base path (GitHub Pages)

For project sites like https://user.github.io/repo/:

{ "basePath": "/repo" }

Then run:

docslit deploy --github-pages

Redirects

{ "redirects": { "/old-guide": "/getting-started/introduction", "/legacy": "https://example.com" } }

You can also set frontmatter redirect: /new-path on a page. Builds emit meta-refresh stubs plus _redirects and vercel.json entries.

Array form

The object form is always permanent. To set the status or use patterns, write redirects as an array. permanent defaults to true, which sends a 301. Set it to false for a 302.

{ "redirects": [ { "source": "/beta", "destination": "/getting-started/introduction", "permanent": false } ] }

Pattern syntax

A source can contain these patterns:

Pattern Matches
:name One path segment
:name* The rest of the path, which can be empty. It must be the last part of the source
* The rest of the path. It must be the last part of the source

A destination can reuse the captures with :name, :name*, *, or :splat for the rest of the path.

This example moves a whole folder and keeps one page at its old place:

{ "redirects": [ { "source": "/guides/legacy-setup", "destination": "/getting-started/quickstart" }, { "source": "/guides/:slug*", "destination": "/docs/:slug*" } ] }

/guides/legacy-setup goes to the quickstart, and /guides/auth/tokens goes to /docs/auth/tokens. The exact rule wins because exact rules are written first.

How each host handles redirects

  • Exact rules get an HTML redirect page. Pattern rules don't.
  • _redirects (Netlify and Cloudflare Pages) lists exact rules first, then patterns. A rest capture is written as * and :splat. The status is 301, or 302 when permanent is false.
  • vercel.json writes a rest capture as :splat* and passes permanent through.
  • GitHub Pages ignores pattern redirects. The build prints a note when your config has them.

See Static hosting.

Validate checks

docslit validate reports two codes. redirect-invalid means a bad pattern, a rest capture that isn't last, or a destination that uses a capture the source doesn't have. redirect-target-missing means an exact internal destination isn't a known page or redirect source. Validation understands basePath, version and locale prefixes. The build skips invalid rules with a warning.