|
| 1 | +import { createRequire } from 'module' |
| 2 | +import { defineAdditionalConfig, type DefaultTheme } from 'vitepress' |
| 3 | + |
| 4 | +const require = createRequire(import.meta.url) |
| 5 | +const pkg = require('vitepress/package.json') |
| 6 | + |
| 7 | +export default defineAdditionalConfig({ |
| 8 | + description: 'Vite と Vue による静的サイトジェネレーター', |
| 9 | + |
| 10 | + themeConfig: { |
| 11 | + nav: nav(), |
| 12 | + |
| 13 | + search: { options: searchOptions() }, |
| 14 | + |
| 15 | + sidebar: { |
| 16 | + '/ja/guide/': { base: '/ja/guide/', items: sidebarGuide() }, |
| 17 | + '/ja/reference/': { base: '/ja/reference/', items: sidebarReference() } |
| 18 | + }, |
| 19 | + |
| 20 | + editLink: { |
| 21 | + pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path', |
| 22 | + text: 'GitHub でこのページを編集' |
| 23 | + }, |
| 24 | + |
| 25 | + footer: { |
| 26 | + message: 'MIT ライセンスの下で公開されています。', |
| 27 | + copyright: 'Copyright © 2019-present Evan You' |
| 28 | + } |
| 29 | + } |
| 30 | +}) |
| 31 | + |
| 32 | +function nav(): DefaultTheme.NavItem[] { |
| 33 | + return [ |
| 34 | + { |
| 35 | + text: 'ガイド', |
| 36 | + link: '/ja/guide/what-is-vitepress', |
| 37 | + activeMatch: '/guide/' |
| 38 | + }, |
| 39 | + { |
| 40 | + text: 'リファレンス', |
| 41 | + link: '/ja/reference/site-config', |
| 42 | + activeMatch: '/reference/' |
| 43 | + }, |
| 44 | + { |
| 45 | + text: pkg.version, |
| 46 | + items: [ |
| 47 | + { |
| 48 | + text: '1.6.4', |
| 49 | + link: 'https://vuejs.github.io/vitepress/v1/' |
| 50 | + }, |
| 51 | + { |
| 52 | + text: '更新履歴', |
| 53 | + link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md' |
| 54 | + }, |
| 55 | + { |
| 56 | + text: 'コントリビュート方法', |
| 57 | + link: 'https://github.com/vuejs/vitepress/blob/main/.github/contributing.md' |
| 58 | + } |
| 59 | + ] |
| 60 | + } |
| 61 | + ] |
| 62 | +} |
| 63 | + |
| 64 | +function sidebarGuide(): DefaultTheme.SidebarItem[] { |
| 65 | + return [ |
| 66 | + { |
| 67 | + text: '導入', |
| 68 | + collapsed: false, |
| 69 | + items: [ |
| 70 | + { text: 'VitePress とは?', link: 'what-is-vitepress' }, |
| 71 | + { text: 'はじめに', link: 'getting-started' }, |
| 72 | + { text: 'ルーティング', link: 'routing' }, |
| 73 | + { text: 'デプロイ', link: 'deploy' } |
| 74 | + ] |
| 75 | + }, |
| 76 | + { |
| 77 | + text: '執筆', |
| 78 | + collapsed: false, |
| 79 | + items: [ |
| 80 | + { text: 'Markdown 拡張', link: 'markdown' }, |
| 81 | + { text: 'アセットの取り扱い', link: 'asset-handling' }, |
| 82 | + { text: 'フロントマター', link: 'frontmatter' }, |
| 83 | + { text: 'Markdown で Vue を使う', link: 'using-vue' }, |
| 84 | + { text: '多言語対応', link: 'i18n' } |
| 85 | + ] |
| 86 | + }, |
| 87 | + { |
| 88 | + text: 'カスタマイズ', |
| 89 | + collapsed: false, |
| 90 | + items: [ |
| 91 | + { text: 'カスタムテーマを使う', link: 'custom-theme' }, |
| 92 | + { |
| 93 | + text: 'デフォルトテーマの拡張', |
| 94 | + link: 'extending-default-theme' |
| 95 | + }, |
| 96 | + { text: 'ビルド時のデータ読み込み', link: 'data-loading' }, |
| 97 | + { text: 'SSR 互換性', link: 'ssr-compat' }, |
| 98 | + { text: 'CMS との接続', link: 'cms' } |
| 99 | + ] |
| 100 | + }, |
| 101 | + { |
| 102 | + text: '実験的機能', |
| 103 | + collapsed: false, |
| 104 | + items: [ |
| 105 | + { text: 'MPA モード', link: 'mpa-mode' }, |
| 106 | + { text: 'サイトマップ生成', link: 'sitemap-generation' } |
| 107 | + ] |
| 108 | + }, |
| 109 | + { |
| 110 | + text: '設定 & API リファレンス', |
| 111 | + base: '/ja/reference/', |
| 112 | + link: 'site-config' |
| 113 | + } |
| 114 | + ] |
| 115 | +} |
| 116 | + |
| 117 | +function sidebarReference(): DefaultTheme.SidebarItem[] { |
| 118 | + return [ |
| 119 | + { |
| 120 | + text: 'リファレンス', |
| 121 | + items: [ |
| 122 | + { text: 'サイト設定', link: 'site-config' }, |
| 123 | + { text: 'Frontmatter 設定', link: 'frontmatter-config' }, |
| 124 | + { text: 'ランタイム API', link: 'runtime-api' }, |
| 125 | + { text: 'CLI', link: 'cli' }, |
| 126 | + { |
| 127 | + text: 'デフォルトテーマ', |
| 128 | + base: '/ja/reference/default-theme-', |
| 129 | + items: [ |
| 130 | + { text: '概要', link: 'config' }, |
| 131 | + { text: 'ナビゲーション', link: 'nav' }, |
| 132 | + { text: 'サイドバー', link: 'sidebar' }, |
| 133 | + { text: 'ホームページ', link: 'home-page' }, |
| 134 | + { text: 'フッター', link: 'footer' }, |
| 135 | + { text: 'レイアウト', link: 'layout' }, |
| 136 | + { text: 'バッジ', link: 'badge' }, |
| 137 | + { text: 'チームページ', link: 'team-page' }, |
| 138 | + { text: '前 / 次 リンク', link: 'prev-next-links' }, |
| 139 | + { text: '編集リンク', link: 'edit-link' }, |
| 140 | + { text: '最終更新日時', link: 'last-updated' }, |
| 141 | + { text: '検索', link: 'search' }, |
| 142 | + { text: 'Carbon 広告', link: 'carbon-ads' } |
| 143 | + ] |
| 144 | + } |
| 145 | + ] |
| 146 | + } |
| 147 | + ] |
| 148 | +} |
| 149 | + |
| 150 | +function searchOptions(): Partial<DefaultTheme.AlgoliaSearchOptions> { |
| 151 | + return { |
| 152 | + placeholder: 'ドキュメントを検索', |
| 153 | + translations: { |
| 154 | + button: { |
| 155 | + buttonText: '検索', |
| 156 | + buttonAriaLabel: '検索' |
| 157 | + }, |
| 158 | + modal: { |
| 159 | + searchBox: { |
| 160 | + clearButtonTitle: '検索をクリア', |
| 161 | + clearButtonAriaLabel: '検索をクリア', |
| 162 | + closeButtonText: '閉じる', |
| 163 | + closeButtonAriaLabel: '閉じる', |
| 164 | + placeholderText: 'ドキュメントを検索', |
| 165 | + placeholderTextAskAi: 'AI に質問: ', |
| 166 | + placeholderTextAskAiStreaming: '回答を作成中...', |
| 167 | + searchInputLabel: '検索', |
| 168 | + backToKeywordSearchButtonText: 'キーワード検索に戻る', |
| 169 | + backToKeywordSearchButtonAriaLabel: 'キーワード検索に戻る' |
| 170 | + }, |
| 171 | + startScreen: { |
| 172 | + recentSearchesTitle: '検索履歴', |
| 173 | + noRecentSearchesText: '最近の検索はありません', |
| 174 | + saveRecentSearchButtonTitle: '検索履歴に保存', |
| 175 | + removeRecentSearchButtonTitle: '検索履歴から削除', |
| 176 | + favoriteSearchesTitle: 'お気に入り', |
| 177 | + removeFavoriteSearchButtonTitle: 'お気に入りから削除', |
| 178 | + recentConversationsTitle: '最近の会話', |
| 179 | + removeRecentConversationButtonTitle: '会話履歴から削除' |
| 180 | + }, |
| 181 | + errorScreen: { |
| 182 | + titleText: '結果を取得できません', |
| 183 | + helpText: 'ネットワーク接続を確認してください' |
| 184 | + }, |
| 185 | + noResultsScreen: { |
| 186 | + noResultsText: '結果が見つかりません', |
| 187 | + suggestedQueryText: '別の検索語を試してください', |
| 188 | + reportMissingResultsText: '結果があるはずだと思いますか?', |
| 189 | + reportMissingResultsLinkText: 'フィードバックを送る' |
| 190 | + }, |
| 191 | + resultsScreen: { |
| 192 | + askAiPlaceholder: 'AI に質問: ' |
| 193 | + }, |
| 194 | + askAiScreen: { |
| 195 | + disclaimerText: |
| 196 | + 'AI が生成した回答には誤りが含まれる可能性があります。必ずご確認ください。', |
| 197 | + relatedSourcesText: '関連ソース', |
| 198 | + thinkingText: '考え中...', |
| 199 | + copyButtonText: 'コピー', |
| 200 | + copyButtonCopiedText: 'コピーしました!', |
| 201 | + copyButtonTitle: 'コピー', |
| 202 | + likeButtonTitle: 'いいね', |
| 203 | + dislikeButtonTitle: 'よくない', |
| 204 | + thanksForFeedbackText: 'フィードバックありがとうございます!', |
| 205 | + preToolCallText: '検索中...', |
| 206 | + duringToolCallText: '検索中 ', |
| 207 | + afterToolCallText: '検索完了', |
| 208 | + aggregatedToolCallText: '検索完了' |
| 209 | + }, |
| 210 | + footer: { |
| 211 | + selectText: '選択', |
| 212 | + submitQuestionText: '質問を送信', |
| 213 | + selectKeyAriaLabel: 'Enter キー', |
| 214 | + navigateText: '移動', |
| 215 | + navigateUpKeyAriaLabel: '上矢印キー', |
| 216 | + navigateDownKeyAriaLabel: '下矢印キー', |
| 217 | + closeText: '閉じる', |
| 218 | + backToSearchText: '検索に戻る', |
| 219 | + closeKeyAriaLabel: 'Esc キー', |
| 220 | + poweredByText: '提供: ' |
| 221 | + } |
| 222 | + } |
| 223 | + } |
| 224 | + } |
| 225 | +} |
0 commit comments