設定リファレンス#
プロジェクトルートに nulldepdoc.config.json(または ESM 形式の nulldepdoc.config.mjs / nulldepdoc.config.js)を配置すると自動で読み込まれます。
サイト設定ファイル(nulldepdoc.config.json)#
nulldepdoc.config.json
{
"title": "nulldepdoc",
"tagline": "完全ゼロ依存の静的ドキュメントサイト生成基盤",
"docsDir": "docs",
"staticDir": "static",
"outDir": "dist",
"basePath": "/",
"lang": "ja",
"onBrokenLinks": "error",
"customCss": "/site-custom.css",
"customScripts": ["/dep-compare.js"],
"nav": [
{ "label": "はじめに", "href": "/getting-started/" },
{ "label": "GitHub", "href": "https://github.com/stakme/nulldepdoc" }
],
"footer": "Built with nulldepdoc — 0 npm dependencies."
}| キー | 型 | デフォルト | 説明 |
|---|---|---|---|
title | string | "Documentation" | サイトタイトル(ナビバーと <title> に使用) |
tagline | string | "" | ページ固有の description がない場合の <meta name="description"> |
docsDir | string | "docs" | Markdown 文書のルートディレクトリ |
staticDir | string | "static" | そのまま outDir へコピーされる静的アセットディレクトリ |
outDir | string | "dist" | 静的サイト出力先(原本やルートと重なるパスは安全のため拒否) |
basePath | string | "/" | サブパス公開用のベースパス(例:"/nulldepdoc/") |
lang | string | "en" | <html lang="..."> 属性値 |
onBrokenLinks | "error" | "warn" | "ignore" | "warn" | 内部リンク・アンカー・nav リンク切れ検知時の挙動 |
includeDrafts | boolean | false | draft: true のページを出力対象に含めるかどうか |
nav | Array<{ label, href }> | [] | 上部ナビゲーションバーのリンク一覧 |
footer | string | "" | 記事下部に表示するフッター文字列 |
customCss | string | "" | 追加読み込むカスタム CSS のパス(static/ 配下など) |
customScripts | string[] | [] | 独自 Web Components 等を読み込む ESM スクリプトパス配列 |
Frontmatter 項目#
Markdown ファイル先頭の --- ブロックでページ単位のメタデータを指定できます(インラインコメント # ... 対応)。
yaml
---
title: ページタイトル
sidebar_label: サイドバー用の短い名前
sidebar_position: 1
description: 検索結果や meta description に表示される説明
slug: /custom-url/
tags: [guide, architecture]
draft: false # true にすると本番ビルドから除外
sidebar_hidden: false
---カテゴリ設定(_category.json)#
docs/ 配下のサブディレクトリに _category.json を置くと、サイドバーのカテゴリ表示をカスタマイズできます。
docs/guides/_category.json
{
"label": "設計・運用ガイド",
"position": 4,
"collapsed": false
}