Skip to content

Commit 67360bb

Browse files
committed
feat(docs): add VitePress documentation site with i18n and custom theme
- set up VitePress config with 5 locales (zh-CN root, en/fr/es/pt) via rewrites - add warm-gold + rose-pink custom theme with dark mode support - add BackToTop component, multilingual NotFound page, medium-zoom integration - add PWA support via @vite-pwa/vitepress with auto-update and Workbox - add home pages for all 5 locales with hero section and feature cards - add logo.svg to docs/public for nav and PWA manifest
1 parent 548757b commit 67360bb

16 files changed

Lines changed: 1237 additions & 5 deletions

File tree

.claude/index.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,29 @@
148148
"release_trigger": ["push tags v*", "workflow_dispatch"],
149149
"publish_registry": "https://registry.npmjs.org"
150150
},
151+
"docs": {
152+
"site": "https://cli.fishxcode.com",
153+
"engine": "vitepress@^1.6.4",
154+
"source_dir": "docs/",
155+
"output_dir": "docs/.vitepress/dist",
156+
"deploy": "vercel",
157+
"locales": ["zh-CN (root)", "en", "fr", "es", "pt"],
158+
"rewrites": { "zh-CN/:path": ":path" },
159+
"theme": "custom (warm gold + rose-pink, dark mode)",
160+
"plugins": ["@vite-pwa/vitepress", "vitepress-plugin-group-icons", "medium-zoom"],
161+
"scripts": ["docs:dev", "docs:build", "docs:preview"],
162+
"config": "docs/.vitepress/config.mts",
163+
"theme_dir": "docs/.vitepress/theme/"
164+
},
151165
"gaps_summary": [
152166
"命令层(src/commands/)无单元测试",
153167
"适配器层 configure/reset 无集成测试",
154168
"balance 命令未接入服务端 API",
155-
"cursor 工具适配器未实现",
156-
"无 ESLint/Biome 等 Lint 配置"
169+
"cursor 工具适配器未实现"
157170
],
158171
"next_scan_priority": [
159172
"test/(补充适配器集成测试后重新扫描)",
160-
"src/commands/balance.ts(功能实现后更新文档)"
173+
"src/commands/balance.ts(balance 功能实现后更新文档)",
174+
"docs/(VitePress 文档内容扩充后重新扫描)"
161175
]
162176
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ bun.lockb
44
dist
55
.DS_Store
66
coverage
7+
docs/.vitepress/dist
8+
docs/.vitepress/cache

docs/.vitepress/config.mts

Lines changed: 304 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,304 @@
1+
import { defineConfig } from 'vitepress'
2+
import { withPwa } from '@vite-pwa/vitepress'
3+
import { groupIconVitePlugin } from 'vitepress-plugin-group-icons'
4+
5+
const SITE_URL = 'https://cli.fishxcode.com'
6+
const SITE_TITLE = 'FishXCode CLI'
7+
const SITE_DESC = 'AI 编码工具管理器 — 一键接入 FishXCode API,支持 claude-code、aider、codex、opencode 等主流工具'
8+
9+
const BASE = (process.env.VITEPRESS_BASE ?? '/').replace(/([^/])$/, '$1/')
10+
11+
function p(path: string) {
12+
return BASE.replace(/\/$/, '') + path
13+
}
14+
15+
export default withPwa(defineConfig({
16+
base: BASE,
17+
title: SITE_TITLE,
18+
description: SITE_DESC,
19+
lastUpdated: true,
20+
cleanUrls: true,
21+
rewrites: {
22+
'zh-CN/:path': ':path',
23+
},
24+
sitemap: {
25+
hostname: SITE_URL,
26+
},
27+
head: [
28+
['link', { rel: 'icon', href: p('/logo.svg') }],
29+
['meta', { property: 'og:type', content: 'website' }],
30+
['meta', { property: 'og:site_name', content: SITE_TITLE }],
31+
['meta', { property: 'og:title', content: SITE_TITLE }],
32+
['meta', { property: 'og:description', content: SITE_DESC }],
33+
['meta', { property: 'og:url', content: SITE_URL }],
34+
['meta', { name: 'twitter:card', content: 'summary' }],
35+
['meta', { name: 'twitter:site', content: '@fishxcode' }],
36+
],
37+
vite: {
38+
plugins: [groupIconVitePlugin()],
39+
},
40+
pwa: {
41+
registerType: 'autoUpdate',
42+
manifest: {
43+
name: SITE_TITLE,
44+
short_name: 'FishX CLI',
45+
description: SITE_DESC,
46+
theme_color: '#c9973e',
47+
icons: [
48+
{ src: '/logo.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'any maskable' },
49+
],
50+
},
51+
workbox: {
52+
globPatterns: ['**/*.{css,js,html,svg,png,jpg,ico,txt,woff2}'],
53+
},
54+
},
55+
locales: {
56+
root: {
57+
label: '简体中文',
58+
lang: 'zh-CN',
59+
themeConfig: {
60+
nav: [
61+
{ text: '首页', link: '/' },
62+
{ text: '快速开始', link: '/quick-start' },
63+
{ text: '命令参考', link: '/commands' },
64+
{ text: '工具列表', link: '/tools' },
65+
{ text: '发布日志', link: '/release' },
66+
{ text: '注册账号', link: 'https://fishxcode.com/register?aff=9CTW' },
67+
],
68+
sidebar: [
69+
{
70+
text: '入门',
71+
items: [
72+
{ text: '快速开始', link: '/quick-start' },
73+
],
74+
},
75+
{
76+
text: '参考',
77+
items: [
78+
{ text: '命令参考', link: '/commands' },
79+
{ text: '工具列表', link: '/tools' },
80+
{ text: '发布日志', link: '/release' },
81+
],
82+
},
83+
],
84+
editLink: {
85+
pattern: 'https://github.com/fishxcode/fishxcode-cli/edit/main/docs/zh-CN/:path',
86+
text: '在 GitHub 上编辑此页',
87+
},
88+
lastUpdated: { text: '最后更新于' },
89+
docFooter: { prev: '上一页', next: '下一页' },
90+
outline: { label: '页面导航', level: [2, 3] },
91+
},
92+
},
93+
en: {
94+
label: 'English',
95+
lang: 'en-US',
96+
link: '/en/',
97+
themeConfig: {
98+
nav: [
99+
{ text: 'Home', link: '/en/' },
100+
{ text: 'Quick Start', link: '/en/quick-start' },
101+
{ text: 'Commands', link: '/en/commands' },
102+
{ text: 'Tools', link: '/en/tools' },
103+
{ text: 'Release', link: '/en/release' },
104+
{ text: 'Register', link: 'https://fishxcode.com/register?aff=9CTW' },
105+
],
106+
sidebar: [
107+
{
108+
text: 'Getting Started',
109+
items: [
110+
{ text: 'Quick Start', link: '/en/quick-start' },
111+
],
112+
},
113+
{
114+
text: 'Reference',
115+
items: [
116+
{ text: 'Commands', link: '/en/commands' },
117+
{ text: 'Tools', link: '/en/tools' },
118+
{ text: 'Release Notes', link: '/en/release' },
119+
],
120+
},
121+
],
122+
editLink: {
123+
pattern: 'https://github.com/fishxcode/fishxcode-cli/edit/main/docs/en/:path',
124+
text: 'Edit this page on GitHub',
125+
},
126+
lastUpdated: { text: 'Last updated' },
127+
docFooter: { prev: 'Previous page', next: 'Next page' },
128+
outline: { label: 'On this page', level: [2, 3] },
129+
},
130+
},
131+
fr: {
132+
label: 'Français',
133+
lang: 'fr-FR',
134+
link: '/fr/',
135+
themeConfig: {
136+
nav: [
137+
{ text: 'Accueil', link: '/fr/' },
138+
{ text: 'Démarrage', link: '/fr/quick-start' },
139+
{ text: 'Commandes', link: '/fr/commands' },
140+
{ text: 'Outils', link: '/fr/tools' },
141+
{ text: 'Notes', link: '/fr/release' },
142+
{ text: "S'inscrire", link: 'https://fishxcode.com/register?aff=9CTW' },
143+
],
144+
sidebar: [
145+
{
146+
text: 'Démarrage',
147+
items: [
148+
{ text: 'Démarrage rapide', link: '/fr/quick-start' },
149+
],
150+
},
151+
{
152+
text: 'Référence',
153+
items: [
154+
{ text: 'Commandes', link: '/fr/commands' },
155+
{ text: 'Outils', link: '/fr/tools' },
156+
{ text: 'Notes de version', link: '/fr/release' },
157+
],
158+
},
159+
],
160+
editLink: {
161+
pattern: 'https://github.com/fishxcode/fishxcode-cli/edit/main/docs/fr/:path',
162+
text: 'Modifier cette page sur GitHub',
163+
},
164+
lastUpdated: { text: 'Dernière mise à jour' },
165+
docFooter: { prev: 'Page précédente', next: 'Page suivante' },
166+
outline: { label: 'Sur cette page', level: [2, 3] },
167+
},
168+
},
169+
es: {
170+
label: 'Español',
171+
lang: 'es-ES',
172+
link: '/es/',
173+
themeConfig: {
174+
nav: [
175+
{ text: 'Inicio', link: '/es/' },
176+
{ text: 'Comenzar', link: '/es/quick-start' },
177+
{ text: 'Comandos', link: '/es/commands' },
178+
{ text: 'Herramientas', link: '/es/tools' },
179+
{ text: 'Versiones', link: '/es/release' },
180+
{ text: 'Registrarse', link: 'https://fishxcode.com/register?aff=9CTW' },
181+
],
182+
sidebar: [
183+
{
184+
text: 'Comenzar',
185+
items: [
186+
{ text: 'Inicio rápido', link: '/es/quick-start' },
187+
],
188+
},
189+
{
190+
text: 'Referencia',
191+
items: [
192+
{ text: 'Comandos', link: '/es/commands' },
193+
{ text: 'Herramientas', link: '/es/tools' },
194+
{ text: 'Notas de versión', link: '/es/release' },
195+
],
196+
},
197+
],
198+
editLink: {
199+
pattern: 'https://github.com/fishxcode/fishxcode-cli/edit/main/docs/es/:path',
200+
text: 'Editar esta página en GitHub',
201+
},
202+
lastUpdated: { text: 'Última actualización' },
203+
docFooter: { prev: 'Página anterior', next: 'Página siguiente' },
204+
outline: { label: 'En esta página', level: [2, 3] },
205+
},
206+
},
207+
pt: {
208+
label: 'Português',
209+
lang: 'pt-BR',
210+
link: '/pt/',
211+
themeConfig: {
212+
nav: [
213+
{ text: 'Início', link: '/pt/' },
214+
{ text: 'Começar', link: '/pt/quick-start' },
215+
{ text: 'Comandos', link: '/pt/commands' },
216+
{ text: 'Ferramentas', link: '/pt/tools' },
217+
{ text: 'Versões', link: '/pt/release' },
218+
{ text: 'Registrar', link: 'https://fishxcode.com/register?aff=9CTW' },
219+
],
220+
sidebar: [
221+
{
222+
text: 'Começar',
223+
items: [
224+
{ text: 'Início rápido', link: '/pt/quick-start' },
225+
],
226+
},
227+
{
228+
text: 'Referência',
229+
items: [
230+
{ text: 'Comandos', link: '/pt/commands' },
231+
{ text: 'Ferramentas', link: '/pt/tools' },
232+
{ text: 'Notas de versão', link: '/pt/release' },
233+
],
234+
},
235+
],
236+
editLink: {
237+
pattern: 'https://github.com/fishxcode/fishxcode-cli/edit/main/docs/pt/:path',
238+
text: 'Editar esta página no GitHub',
239+
},
240+
lastUpdated: { text: 'Última atualização' },
241+
docFooter: { prev: 'Página anterior', next: 'Próxima página' },
242+
outline: { label: 'Nesta página', level: [2, 3] },
243+
},
244+
},
245+
},
246+
themeConfig: {
247+
logo: '/logo.svg',
248+
search: {
249+
provider: 'local',
250+
options: {
251+
locales: {
252+
root: {
253+
translations: {
254+
button: { buttonText: '搜索文档', buttonAriaLabel: '搜索文档' },
255+
modal: {
256+
noResultsText: '无法找到相关结果',
257+
resetButtonTitle: '清除查询条件',
258+
footer: { selectText: '选择', navigateText: '切换', closeText: '关闭' },
259+
},
260+
},
261+
},
262+
fr: {
263+
translations: {
264+
button: { buttonText: 'Rechercher', buttonAriaLabel: 'Rechercher' },
265+
modal: {
266+
noResultsText: 'Aucun résultat trouvé',
267+
resetButtonTitle: 'Réinitialiser',
268+
footer: { selectText: 'Sélectionner', navigateText: 'Naviguer', closeText: 'Fermer' },
269+
},
270+
},
271+
},
272+
es: {
273+
translations: {
274+
button: { buttonText: 'Buscar', buttonAriaLabel: 'Buscar' },
275+
modal: {
276+
noResultsText: 'No se encontraron resultados',
277+
resetButtonTitle: 'Restablecer',
278+
footer: { selectText: 'Seleccionar', navigateText: 'Navegar', closeText: 'Cerrar' },
279+
},
280+
},
281+
},
282+
pt: {
283+
translations: {
284+
button: { buttonText: 'Pesquisar', buttonAriaLabel: 'Pesquisar' },
285+
modal: {
286+
noResultsText: 'Nenhum resultado encontrado',
287+
resetButtonTitle: 'Limpar',
288+
footer: { selectText: 'Selecionar', navigateText: 'Navegar', closeText: 'Fechar' },
289+
},
290+
},
291+
},
292+
},
293+
},
294+
},
295+
socialLinks: [
296+
{ icon: 'x', link: 'https://x.com/fishxcode' },
297+
{ icon: 'github', link: 'https://github.com/fishxcode/fishxcode-cli' },
298+
],
299+
footer: {
300+
message: '<a href="https://fishxcode.com" target="_blank">主站</a> | <a href="https://doc.fishxcode.com" target="_blank">文档站</a> | <a href="https://github.com/fishxcode/fishxcode-cli" target="_blank">GitHub</a>',
301+
copyright: `Copyright © ${new Date().getFullYear()} FishXCode`,
302+
},
303+
},
304+
}))

0 commit comments

Comments
 (0)