Skip to main content
independoc
Language: English

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)#

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."
}
KeyTypeDefaultDescription
titlestring"Documentation"Site title used in the navbar and <title>
taglinestring""Fallback <meta name="description"> when a page has no description
docsDirstring"docs"Root directory for Markdown documents
staticDirstring"static"Static asset directory copied verbatim into outDir
outDirstring"dist"Output directory (paths overlapping source/root are rejected for safety)
basePathstring"/"Base URL prefix for sub-path hosting (e.g. "/independoc/")
langstring"en"<html lang="..."> attribute value
onBrokenLinks"error" | "warn" | "ignore""warn"Behavior when broken internal links, anchors, or nav links are detected
includeDraftsbooleanfalseInclude documents with draft: true
navArray<{ label, href }>[]Top navbar links
footerstring""Footer text displayed below article content
bottomLink{ label, href } | nullnullOptional link displayed below pagination
customCssstring""Additional stylesheet path (e.g. under static/)
customScriptsstring[][]ESM script paths for custom Web Components

Frontmatter Fields#

Specify per-page metadata in a leading --- block (supports inline # ... comments).

yaml
---
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.

i18n/en/docs/guides/_category.json
{
  "label": "Guides",
  "position": 5,
  "collapsed": false
}

Reading & Operational UX#

json
{
  "breadcrumbs": true,
  "editBaseUrl": "https://github.com/stakme/independoc/edit/main/docs/",
  "showLastUpdated": true
}
KeyTypeDefaultDescription
breadcrumbsbooleantrueAuto-generate breadcrumbs from sidebar hierarchy
editBaseUrlstring""Base URL for "Edit this page" links (override per page with custom_edit_url, or null to hide)
showLastUpdatedbooleanfalseShow 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#

json
{
  "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#

json
{
  "siteUrl": "https://stakme.github.io",
  "basePath": "/independoc/",
  "seo": {
    "ogImage": "/og-image.svg",
    "twitterCard": "summary_large_image",
    "sitemap": true
  },
  "llmsTxt": {
    "enabled": true,
    "full": true
  }
}
KeyDescription
siteUrlhttp: / https: origin used to build absolute canonical, og:url, and sitemap.xml URLs
seo.ogImageSite-wide Open Graph image (overridable per page via Frontmatter image)
seo.sitemapSet to false to disable sitemap.xml generation
llmsTxt.enabledGenerate llms.txt page index
llmsTxt.fullAlso 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).

json
{
  "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/" }]
      }
    }
  }
}
  • defaultLocale is served at / by default; other locales are served at /<locale>/.
  • Setting prefixDefaultLocale: true places all locales under /<locale>/ and generates a language-detecting redirect page at /.
  • Setting fallbackToDefault: true populates untranslated pages from the default locale with a fallback banner and data-fallback-locale.
  • Search indexes are generated per locale (/search-index.json, /en/search-index.json, /zh/search-index.json), along with a language switcher and hreflang link tags.
  • UI strings can be overridden per locale via localeConfigs.<locale>.messages.

Documentation Versioning#

json
{
  "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.

json
{
  "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.

Edit this pageLast updated:
Built with independoc itself — 0 npm dependencies.