Configuration Reference#
Place independoc.config.json (or ESM independoc.config.mjs / independoc.config.js) in your project root and independoc loads it automatically.
Site Configuration (independoc.config.json)#
{
"title": "independoc",
"tagline": "Zero-dependency static documentation site generator",
"docsDir": "docs",
"staticDir": "static",
"outDir": "dist",
"basePath": "/",
"lang": "en",
"onBrokenLinks": "error",
"customCss": "/site-custom.css",
"customScripts": ["/hello-counter.js"],
"showLastUpdated": true,
"nav": [
{ "label": "Getting Started", "href": "/getting-started/" },
{ "label": "GitHub", "href": "https://github.com/stakme/independoc" }
],
"footer": "Built with independoc — 0 npm dependencies."
}| Key | Type | Default | Description |
|---|---|---|---|
title | string | "Documentation" | Site title used in the navbar and <title> |
tagline | string | "" | Fallback <meta name="description"> when a page has no description |
docsDir | string | "docs" | Root directory for Markdown documents |
staticDir | string | "static" | Static asset directory copied verbatim into outDir |
outDir | string | "dist" | Output directory (paths overlapping source/root are rejected for safety) |
basePath | string | "/" | Base URL prefix for sub-path hosting (e.g. "/independoc/") |
lang | string | "en" | <html lang="..."> attribute value |
onBrokenLinks | "error" | "warn" | "ignore" | "warn" | Behavior when broken internal links, anchors, or nav links are detected |
includeDrafts | boolean | false | Include documents with draft: true |
nav | Array<{ label, href }> | [] | Top navbar links |
footer | string | "" | Footer text displayed below article content |
bottomLink | { label, href } | null | null | Optional link displayed below pagination |
customCss | string | "" | Additional stylesheet path (e.g. under static/) |
customScripts | string[] | [] | ESM script paths for custom Web Components |
Frontmatter Fields#
Specify per-page metadata in a leading --- block (supports inline # ... comments).
---
title: Page Title
sidebar_label: Short Sidebar Label
sidebar_position: 1
description: Summary shown in search results and meta description
slug: /custom-url/
tags: [guide, architecture]
image: /og-image.svg
custom_edit_url: https://github.com/stakme/independoc/edit/main/docs/example.md
draft: false # Exclude from production build when true
sidebar_hidden: false
---Category Configuration (_category.json)#
Place _category.json inside a subdirectory of docs/ to customize how that category appears in the sidebar.
{
"label": "Guides",
"position": 5,
"collapsed": false
}Reading & Operational UX#
{
"breadcrumbs": true,
"editBaseUrl": "https://github.com/stakme/independoc/edit/main/docs/",
"showLastUpdated": true
}| Key | Type | Default | Description |
|---|---|---|---|
breadcrumbs | boolean | true | Auto-generate breadcrumbs from sidebar hierarchy |
editBaseUrl | string | "" | Base URL for "Edit this page" links (override per page with custom_edit_url, or null to hide) |
showLastUpdated | boolean | false | Show last updated date from git log -1 --format=%cI (falls back to file mtime outside Git) |
The right-hand Table of Contents also highlights the active heading automatically via IntersectionObserver.
Tags#
{
"tags": {
"enabled": true,
"baseRoute": "/tags/"
}
}When pages declare Frontmatter tags, tag badges plus /tags/ and /tags/<slug>/ pages are statically generated. Tag slugs use slugify(), supporting Unicode/CJK tags and merging case variants into a single group. Search supports tag:<keyword> filtering in addition to regular keywords.
SEO & AI Agent Outputs#
{
"siteUrl": "https://stakme.github.io",
"basePath": "/independoc/",
"seo": {
"ogImage": "/og-image.svg",
"twitterCard": "summary_large_image",
"sitemap": true
},
"llmsTxt": {
"enabled": true,
"full": true
}
}| Key | Description |
|---|---|
siteUrl | http: / https: origin used to build absolute canonical, og:url, and sitemap.xml URLs |
seo.ogImage | Site-wide Open Graph image (overridable per page via Frontmatter image) |
seo.sitemap | Set to false to disable sitemap.xml generation |
llmsTxt.enabled | Generate llms.txt page index |
llmsTxt.full | Also generate llms-full.txt concatenated Markdown document |
Collisions between generated files and static/ files are rejected before writing.
Internationalization (i18n)#
This official site itself is built in three languages: Japanese (ja), English (en), and Chinese (zh).
{
"lang": "ja",
"i18n": {
"defaultLocale": "ja",
"locales": ["ja", "en", "zh"],
"prefixDefaultLocale": false,
"fallbackToDefault": false,
"localeConfigs": {
"ja": {
"label": "日本語",
"htmlLang": "ja",
"docsDir": "docs",
"title": "independoc",
"nav": [{ "label": "はじめに", "href": "/getting-started/" }]
},
"en": {
"label": "English",
"htmlLang": "en",
"docsDir": "i18n/en/docs",
"title": "independoc",
"nav": [{ "label": "Getting Started", "href": "/getting-started/" }]
},
"zh": {
"label": "中文",
"htmlLang": "zh-CN",
"docsDir": "i18n/zh/docs",
"title": "independoc",
"nav": [{ "label": "快速开始", "href": "/getting-started/" }]
}
}
}
}defaultLocaleis served at/by default; other locales are served at/<locale>/.- Setting
prefixDefaultLocale: trueplaces all locales under/<locale>/and generates a language-detecting redirect page at/. - Setting
fallbackToDefault: truepopulates untranslated pages from the default locale with a fallback banner anddata-fallback-locale. - Search indexes are generated per locale (
/search-index.json,/en/search-index.json,/zh/search-index.json), along with a language switcher andhreflanglink tags. - UI strings can be overridden per locale via
localeConfigs.<locale>.messages.
Documentation Versioning#
{
"versions": {
"current": { "label": "Next", "path": "next" },
"latest": "v2",
"items": [
{ "name": "v2", "label": "v2.x (Latest)", "docsDir": "versioned_docs/v2", "path": "" },
{ "name": "v1", "label": "v1.x", "docsDir": "versioned_docs/v1", "path": "v1", "banner": "unmaintained" }
]
}
}The latest version is emitted at /, while current and older versions are emitted under /<path>/. Each version gets its own sidebar, prev/next navigation, and search index, plus a navbar version switcher and version warning banners.
Bottom Link & Mobile Navigation#
{
"bottomLink": {
"label": "GitHub — stakme/independoc",
"href": "https://github.com/stakme/independoc"
}
}When bottomLink is configured, a link is rendered at the bottom of every page after pagination. On viewports 820px wide or narrower, top navbar links automatically move inside the slide-out mobile sidebar menu.