設定リファレンス
このテンプレートの設定ファイルは2つだけです。
astro.config.mjs
Section titled “astro.config.mjs”Astro 本体と Starlight の設定です。サイトのタイトルとサイドバーはここで変更します。
export default defineConfig({ integrations: [ starlight({ title: 'Astro Starlight Docs', // ヘッダーに表示されるサイト名 sidebar: [ /* サイドバーの構成(詳細は「ページの追加方法」参照) */ ], }), ],});主な設定項目:
| 項目 | 説明 |
|---|---|
title |
サイト名。ヘッダーと <title> に使われる |
sidebar |
サイドバーの構成。手動指定と autogenerate を併用できる |
locales |
UI の言語設定。このテンプレートは日本語(ja)に設定済み |
その他の項目は Starlight 設定リファレンス を参照してください。
src/content.config.ts
Section titled “src/content.config.ts”ドキュメントのコンテンツコレクション定義です。docsSchema() によって各ページのフロントマター(title や description など)がビルド時に検証されます。
import { defineCollection } from 'astro:content';import { docsLoader } from '@astrojs/starlight/loaders';import { docsSchema } from '@astrojs/starlight/schema';
export const collections = { docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),};