|
1 | | -// .vitepress/config.js |
| 1 | +// .vitepress/config.ts |
2 | 2 |
|
3 | 3 | const sidebar = (lang = "", override = {}) => { |
4 | | - const items = [ |
5 | | - { page: "getting-started/introduction", text: "Introduction" }, |
6 | | - { page: "getting-started/installation", text: "Installation" }, |
7 | | - { page: "reference/commands", text: "Commands" }, |
8 | | - { page: "reference/overview-scripts", text: "Overview Scripts" }, |
9 | | - { page: "project/roadmap", text: "Roadmap" }, |
10 | | - { page: "project/contributing", text: "Contributing" }, |
11 | | - { page: "project/codeofconduct", text: "Code of Conduct" }, |
12 | | - { page: "project/inspiration", text: "Inspiration" }, |
13 | | - { page: "project/contributors", text: "Contributions" }, |
14 | | - ]; |
| 4 | + const prefix = lang ? `/${lang}` : ""; |
15 | 5 |
|
16 | | - return items.map(item => { |
17 | | - let path = "/"; |
18 | | - |
19 | | - if (lang) { |
20 | | - path += `${lang}/`; |
21 | | - } |
22 | | - |
23 | | - if (item.page) { |
24 | | - path += `${item.page}`; |
25 | | - } |
26 | | - |
27 | | - return { |
28 | | - link: path, |
29 | | - text: override[item.page] || item.text |
30 | | - }; |
31 | | - }); |
| 6 | + return [ |
| 7 | + { |
| 8 | + text: override["getting-started"] || "Getting Started", |
| 9 | + collapsed: false, |
| 10 | + items: [ |
| 11 | + { |
| 12 | + text: override["getting-started/introduction"] || "Introduction", |
| 13 | + link: `${prefix}/getting-started/introduction`, |
| 14 | + }, |
| 15 | + { |
| 16 | + text: override["getting-started/installation"] || "Installation", |
| 17 | + link: `${prefix}/getting-started/installation`, |
| 18 | + }, |
| 19 | + ], |
| 20 | + }, |
| 21 | + { |
| 22 | + text: override["reference"] || "Reference", |
| 23 | + collapsed: false, |
| 24 | + items: [ |
| 25 | + { |
| 26 | + text: override["reference/commands"] || "Commands", |
| 27 | + link: `${prefix}/reference/commands`, |
| 28 | + }, |
| 29 | + { |
| 30 | + text: override["reference/overview-scripts"] || "Overview Scripts", |
| 31 | + link: `${prefix}/reference/overview-scripts`, |
| 32 | + }, |
| 33 | + ], |
| 34 | + }, |
| 35 | + { |
| 36 | + text: override["project"] || "Project", |
| 37 | + collapsed: false, |
| 38 | + items: [ |
| 39 | + { |
| 40 | + text: override["project/roadmap"] || "Roadmap", |
| 41 | + link: `${prefix}/project/roadmap`, |
| 42 | + }, |
| 43 | + { |
| 44 | + text: override["project/contributing"] || "Contributing", |
| 45 | + link: `${prefix}/project/contributing`, |
| 46 | + }, |
| 47 | + { |
| 48 | + text: override["project/codeofconduct"] || "Code of Conduct", |
| 49 | + link: `${prefix}/project/codeofconduct`, |
| 50 | + }, |
| 51 | + { |
| 52 | + text: override["project/inspiration"] || "Inspiration", |
| 53 | + link: `${prefix}/project/inspiration`, |
| 54 | + }, |
| 55 | + { |
| 56 | + text: override["project/contributors"] || "Contributions", |
| 57 | + link: `${prefix}/project/contributors`, |
| 58 | + }, |
| 59 | + ], |
| 60 | + }, |
| 61 | + ]; |
32 | 62 | }; |
33 | 63 |
|
34 | 64 | const nav = (lang = "", override = {}) => { |
35 | 65 | let guidePath = "/getting-started/introduction"; |
36 | | - |
37 | | - if (lang) { |
38 | | - guidePath = `/${lang}/getting-started/introduction`; |
39 | | - } |
| 66 | + if (lang) guidePath = `/${lang}/getting-started/introduction`; |
40 | 67 |
|
41 | 68 | return [ |
42 | 69 | { text: override.home || "Home", link: lang ? `/${lang}/` : "/" }, |
43 | 70 | { text: override.guide || "Guide", link: guidePath }, |
44 | | - { |
| 71 | + { |
45 | 72 | text: "4.4.7", |
46 | 73 | items: [ |
47 | 74 | { |
48 | | - text: override.changelog || 'Changelog', |
49 | | - link: 'https://github.com/harilvfs/carch/blob/main/CHANGELOG.md' |
| 75 | + text: override.changelog || "Changelog", |
| 76 | + link: "https://github.com/harilvfs/carch/blob/main/CHANGELOG.md", |
50 | 77 | }, |
51 | 78 | ], |
52 | 79 | }, |
53 | 80 | ]; |
54 | 81 | }; |
55 | 82 |
|
56 | 83 | export default { |
57 | | - title: 'Carch', |
58 | | - description: 'Documentation website of Carch', |
| 84 | + title: "Carch", |
| 85 | + description: "Documentation website of Carch", |
59 | 86 | lastUpdated: true, |
60 | 87 | cleanUrls: true, |
61 | | - base: '/', |
62 | | - |
63 | | - // Rewrites for different language folders |
64 | | -// rewrites: { |
65 | | -// "README.md": "index.md", |
66 | | -// "np/README.md": "np/index.md", |
67 | | -// "hi/README.md": "hi/index.md", |
68 | | -// ":lang/:path*": ":lang/:path*" |
69 | | -// }, |
70 | | - |
71 | | - head: [ |
72 | | - ["link", { rel: "icon", href: "/carch.png" }], |
73 | | - ], |
| 88 | + base: "/", |
| 89 | + |
| 90 | + head: [["link", { rel: "icon", href: "/carch.png" }]], |
74 | 91 |
|
75 | 92 | locales: { |
76 | 93 | root: { |
77 | 94 | label: "English", |
78 | 95 | lang: "en-US", |
79 | 96 | title: "Carch", |
80 | 97 | description: "Documentation website of CArch", |
81 | | - |
| 98 | + |
82 | 99 | themeConfig: { |
83 | 100 | siteTitle: "Carch", |
84 | 101 | logo: "/carch.png", |
85 | 102 | outline: "deep", |
86 | 103 | docsDir: "/docs", |
87 | | - |
| 104 | + |
88 | 105 | editLink: { |
89 | 106 | pattern: "https://github.com/carch-org/docs/tree/main/docs/:path", |
90 | 107 | text: "Edit this page on GitHub", |
91 | 108 | }, |
92 | | - |
| 109 | + |
93 | 110 | nav: nav("", {}), |
94 | 111 | sidebar: sidebar("", {}), |
95 | | - |
| 112 | + |
96 | 113 | socialLinks: [ |
97 | 114 | { icon: "telegram", link: "https://t.me/carchx" }, |
98 | 115 | { icon: "discord", link: "https://discord.com/invite/8NJWstnUHd" }, |
99 | 116 | { icon: "gmail", link: "mailto:[email protected]" }, |
100 | 117 | ], |
101 | | - |
| 118 | + |
102 | 119 | footer: { |
103 | 120 | message: "Released under the MIT License.", |
104 | 121 | copyright: "Copyright © 2025 Hari Chalise", |
105 | 122 | }, |
106 | | - |
107 | | - returnToTopLabel: 'Go to Top', |
108 | | - sidebarMenuLabel: 'Menu', |
109 | | - } |
| 123 | + |
| 124 | + returnToTopLabel: "Go to Top", |
| 125 | + sidebarMenuLabel: "Menu", |
| 126 | + }, |
110 | 127 | }, |
111 | 128 |
|
112 | 129 | np: { |
113 | 130 | label: "नेपाली", |
114 | | - lang: "ne-NP", |
| 131 | + lang: "ne-NP", |
115 | 132 | title: "सी-आर्च", |
116 | 133 | description: "सी-आर्चको कागजात वेबसाइट", |
117 | | - |
| 134 | + |
118 | 135 | themeConfig: { |
119 | 136 | siteTitle: "सी-आर्च", |
120 | 137 | logo: "/carch.png", |
121 | 138 | outline: "deep", |
122 | 139 | docsDir: "/docs", |
123 | | - |
| 140 | + |
124 | 141 | langMenuLabel: "भाषाहरू", |
125 | 142 | returnToTopLabel: "माथि जानुहोस्", |
126 | 143 | sidebarMenuLabel: "मेनु", |
127 | | - |
| 144 | + |
128 | 145 | editLink: { |
129 | 146 | pattern: "https://github.com/carch-org/docs/tree/main/docs/:path", |
130 | 147 | text: "GitHub मा यो पृष्ठ सम्पादन गर्नुहोस्", |
131 | 148 | }, |
132 | | - |
| 149 | + |
133 | 150 | nav: nav("np", { |
134 | 151 | home: "घर", |
135 | 152 | guide: "गाइड", |
136 | | - changelog: "परिवर्तन लग" |
| 153 | + changelog: "परिवर्तन लग", |
137 | 154 | }), |
138 | | - |
| 155 | + |
139 | 156 | sidebar: sidebar("np", { |
| 157 | + "getting-started": "सुरुवात गर्नुहोस्", |
140 | 158 | "getting-started/introduction": "परिचय", |
141 | 159 | "getting-started/installation": "स्थापना", |
| 160 | + "reference": "सन्दर्भ", |
142 | 161 | "reference/commands": "आदेशहरू", |
143 | 162 | "reference/overview-scripts": "स्क्रिप्ट सिंहावलोकन", |
| 163 | + "project": "परियोजना", |
144 | 164 | "project/roadmap": "रोडम्याप", |
145 | 165 | "project/contributing": "योगदान", |
146 | 166 | "project/codeofconduct": "आचार संहिता", |
147 | 167 | "project/inspiration": "प्रेरणा", |
148 | | - "project/contributors": "योगदानकर्ताहरू" |
| 168 | + "project/contributors": "योगदानकर्ताहरू", |
149 | 169 | }), |
150 | | - |
| 170 | + |
151 | 171 | socialLinks: [ |
152 | 172 | { icon: "telegram", link: "https://t.me/carchx" }, |
153 | 173 | { icon: "discord", link: "https://discord.com/invite/8NJWstnUHd" }, |
154 | 174 | { icon: "gmail", link: "mailto:[email protected]" }, |
155 | 175 | ], |
156 | | - |
| 176 | + |
157 | 177 | footer: { |
158 | 178 | message: "MIT लाइसेन्स अन्तर्गत जारी।", |
159 | 179 | copyright: "प्रतिलिपि अधिकार © २०२५ हरि चालिसे", |
160 | 180 | }, |
161 | | - |
162 | | - } |
| 181 | + }, |
163 | 182 | }, |
164 | 183 |
|
165 | 184 | hi: { |
166 | 185 | label: "हिन्दी", |
167 | 186 | lang: "hi-IN", |
168 | 187 | title: "सी-आर्च", |
169 | 188 | description: "सी-आर्च की दस्तावेज़ वेबसाइट", |
170 | | - |
| 189 | + |
171 | 190 | themeConfig: { |
172 | 191 | siteTitle: "सी-आर्च", |
173 | 192 | logo: "/carch.png", |
174 | 193 | outline: "deep", |
175 | 194 | docsDir: "/docs", |
176 | | - |
| 195 | + |
177 | 196 | langMenuLabel: "भाषाएं", |
178 | 197 | returnToTopLabel: "ऊपर जाएं", |
179 | 198 | sidebarMenuLabel: "मेनू", |
180 | | - |
| 199 | + |
181 | 200 | editLink: { |
182 | 201 | pattern: "https://github.com/carch-org/docs/tree/main/docs/:path", |
183 | 202 | text: "GitHub पर इस पृष्ठ को संपादित करें", |
184 | 203 | }, |
185 | | - |
| 204 | + |
186 | 205 | nav: nav("hi", { |
187 | 206 | home: "होम", |
188 | 207 | guide: "गाइड", |
189 | | - changelog: "चेंजलॉग" |
| 208 | + changelog: "चेंजलॉग", |
190 | 209 | }), |
191 | | - |
| 210 | + |
192 | 211 | sidebar: sidebar("hi", { |
| 212 | + "getting-started": "शुरुआत करें", |
193 | 213 | "getting-started/introduction": "परिचय", |
194 | 214 | "getting-started/installation": "इंस्टॉलेशन", |
| 215 | + "reference": "संदर्भ", |
195 | 216 | "reference/commands": "कमांड्स", |
196 | 217 | "reference/overview-scripts": "स्क्रिप्ट्स का अवलोकन", |
| 218 | + "project": "परियोजना", |
197 | 219 | "project/roadmap": "रोडमैप", |
198 | 220 | "project/contributing": "योगदान", |
199 | 221 | "project/codeofconduct": "आचार संहिता", |
200 | 222 | "project/inspiration": "प्रेरणा", |
201 | | - "project/contributors": "योगदानकर्ता" |
| 223 | + "project/contributors": "योगदानकर्ता", |
202 | 224 | }), |
203 | | - |
| 225 | + |
204 | 226 | socialLinks: [ |
205 | 227 | { icon: "telegram", link: "https://t.me/carchx" }, |
206 | 228 | { icon: "discord", link: "https://discord.com/invite/8NJWstnUHd" }, |
207 | 229 | { icon: "gmail", link: "mailto:[email protected]" }, |
208 | 230 | ], |
209 | | - |
| 231 | + |
210 | 232 | footer: { |
211 | 233 | message: "MIT लाइसेंस के तहत जारी।", |
212 | 234 | copyright: "कॉपीराइट © 2025 हरि चालिसे", |
213 | 235 | }, |
214 | | - |
215 | | - } |
| 236 | + }, |
216 | 237 | }, |
217 | 238 | }, |
218 | 239 |
|
219 | 240 | themeConfig: { |
220 | 241 | logo: "/carch.png", |
221 | | - search: { |
222 | | - provider: "local" |
223 | | - }, |
| 242 | + search: { |
| 243 | + provider: "local", |
| 244 | + }, |
224 | 245 | socialLinks: [ |
225 | 246 | { icon: "telegram", link: "https://t.me/carchx" }, |
226 | 247 | { icon: "discord", link: "https://discord.com/invite/8NJWstnUHd" }, |
227 | 248 | { icon: "gmail", link: "mailto:[email protected]" }, |
228 | 249 | ], |
229 | | - } |
| 250 | + }, |
230 | 251 | }; |
0 commit comments