Advanced Usage

テンプレートのカスタマイズ方法について説明します。

Customizing Theme Colors

src/styles/global.css で CSS 変数を上書きします。

Adding Sidebar Items

frontmatter の sidebarItems を編集するか、Layout.vue の props を拡張します。

Markdown Plugins

astro.config.mjsvite ブロックで markdown-it プラグインを追加できます。

// astro.config.mjs
export default defineConfig({
  vite: {
    plugins: [markdownItAnchor]
  }
})

Adding New Pages

  1. src/pages/.md ファイルを作成
  2. frontmatter に layoutsidebarItems を設定
  3. 開発サーバーが自動でルーティング