From 87620a1141779945db474d49a55b07ed2134a636 Mon Sep 17 00:00:00 2001 From: kurihada Date: Fri, 12 Dec 2025 23:09:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(website):=20=E6=B7=BB=E5=8A=A0=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80=E5=92=8C=E6=A0=B9?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=BF=AB=E6=8D=B7=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 DocsSidebar 文档导航侧边栏组件 - 新增 DocsLayout 文档页面布局模板 - 首页导航添加文档入口链接 - 根目录 package.json 添加各包快捷脚本 --- package.json | 28 +++- .../website/src/components/DocsSidebar.astro | 73 +++++++++ packages/website/src/layouts/DocsLayout.astro | 142 ++++++++++++++++++ packages/website/src/pages/index.astro | 1 + 4 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 packages/website/src/components/DocsSidebar.astro create mode 100644 packages/website/src/layouts/DocsLayout.astro diff --git a/package.json b/package.json index 840d111..1059215 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,37 @@ "test:coverage": "pnpm -r test:coverage", "lint": "pnpm -r lint", "clean": "pnpm -r exec rm -rf dist node_modules", + "typecheck": "pnpm -r typecheck", + + "core:build": "pnpm --filter @ai-assistant/core build", + "core:dev": "pnpm --filter @ai-assistant/core dev", + "core:test": "pnpm --filter @ai-assistant/core test", + "core:test:watch": "pnpm --filter @ai-assistant/core test:watch", + + "server:build": "pnpm --filter @ai-assistant/server build", "server:start": "pnpm --filter @ai-assistant/server start", "server:dev": "pnpm --filter @ai-assistant/server start:dev", + "server:test": "pnpm --filter @ai-assistant/server test", + + "cli:build": "pnpm --filter @ai-assistant/cli build", + "cli:dev": "pnpm --filter @ai-assistant/cli dev", + "cli:serve": "pnpm --filter @ai-assistant/cli serve", + + "web:build": "pnpm --filter @ai-assistant/web build", "web:dev": "pnpm --filter @ai-assistant/web dev", + "web:preview": "pnpm --filter @ai-assistant/web preview", + "web:typecheck": "pnpm --filter @ai-assistant/web typecheck", + + "ui:build": "pnpm --filter @ai-assistant/ui build", + "ui:dev": "pnpm --filter @ai-assistant/ui dev", + + "desktop:build": "pnpm --filter @ai-assistant/desktop build", "desktop:dev": "pnpm --filter @ai-assistant/desktop dev", - "desktop:build": "pnpm --filter @ai-assistant/desktop build" + "desktop:build:debug": "pnpm --filter @ai-assistant/desktop build:debug", + + "website:build": "pnpm --filter @ai-assistant/website build", + "website:dev": "pnpm --filter @ai-assistant/website dev", + "website:preview": "pnpm --filter @ai-assistant/website preview" }, "keywords": [ "ai", diff --git a/packages/website/src/components/DocsSidebar.astro b/packages/website/src/components/DocsSidebar.astro new file mode 100644 index 0000000..a05cf1f --- /dev/null +++ b/packages/website/src/components/DocsSidebar.astro @@ -0,0 +1,73 @@ +--- +interface Props { + currentPath: string; +} + +const { currentPath } = Astro.props; + +const navigation = [ + { + title: '开始', + items: [ + { title: '概览', href: '/docs' }, + ], + }, + { + title: '架构设计', + items: [ + { title: 'GUI Server/Client 架构', href: '/docs/architecture' }, + ], + }, + { + title: '功能设计', + items: [ + { title: '编辑模式', href: '/docs/features/edit-modes' }, + { title: '增强型仓库地图', href: '/docs/features/repo-map' }, + { title: '多模型支持', href: '/docs/features/multi-model' }, + { title: 'Linting 集成', href: '/docs/features/linting' }, + { title: '测试集成', href: '/docs/features/testing' }, + { title: '对话历史管理', href: '/docs/features/chat-history' }, + { title: 'Watch 模式', href: '/docs/features/watch-mode' }, + { title: '语音输入', href: '/docs/features/voice-input' }, + { title: '浏览器 GUI', href: '/docs/features/browser-gui' }, + { title: '配置管理', href: '/docs/features/configuration' }, + { title: 'Checkpoint 增强', href: '/docs/features/checkpoint' }, + ], + }, +]; + +function isActive(href: string): boolean { + // 精确匹配或以 href 开头(用于子路径) + if (currentPath === href || currentPath === href + '/') { + return true; + } + return false; +} +--- + + diff --git a/packages/website/src/layouts/DocsLayout.astro b/packages/website/src/layouts/DocsLayout.astro new file mode 100644 index 0000000..d9c3506 --- /dev/null +++ b/packages/website/src/layouts/DocsLayout.astro @@ -0,0 +1,142 @@ +--- +import DocsSidebar from '../components/DocsSidebar.astro'; + +interface Props { + title: string; + description?: string; +} + +const { title, description } = Astro.props; +const currentPath = Astro.url.pathname; +--- + + + + + + + + + {title} - AI Terminal Assistant + + + + + + +
+ + + + +
+
+
+ +
+
+
+
+ + + + diff --git a/packages/website/src/pages/index.astro b/packages/website/src/pages/index.astro index 0a3060e..5681451 100644 --- a/packages/website/src/pages/index.astro +++ b/packages/website/src/pages/index.astro @@ -45,6 +45,7 @@ const features = [
功能 快速开始 + 文档