|
| 1 | +import { defineConfig } from 'vitepress' |
| 2 | + |
| 3 | +const base = process.env.VITEPRESS_BASE || '/' |
| 4 | + |
| 5 | +const nav = [ |
| 6 | + { text: '起步', link: '/guide/why-ai-coding' }, |
| 7 | + { text: '工作流', link: '/workflow/overview' }, |
| 8 | + { text: 'Harness', link: '/harness/overview' }, |
| 9 | + { text: '验收', link: '/acceptance/ai-native-acceptance' }, |
| 10 | + { text: '质量', link: '/quality/architecture' }, |
| 11 | + { text: '团队', link: '/team/operating-model' }, |
| 12 | + { text: '模板', link: '/reference/prompt-library' }, |
| 13 | + { text: '附录', link: '/appendix/claude-code-best-practices' }, |
| 14 | + { text: 'GitHub', link: 'https://github.com/limecloud/aicoding' } |
| 15 | +] |
| 16 | + |
| 17 | +const sidebar = [ |
| 18 | + { |
| 19 | + text: '起步', |
| 20 | + items: [ |
| 21 | + { text: '总览', link: '/' }, |
| 22 | + { text: '为什么需要 AI Coding 体系', link: '/guide/why-ai-coding' }, |
| 23 | + { text: 'AI Coding 操作系统', link: '/guide/operating-system' }, |
| 24 | + { text: '成熟度模型', link: '/guide/maturity-model' } |
| 25 | + ] |
| 26 | + }, |
| 27 | + { |
| 28 | + text: '工作流', |
| 29 | + items: [ |
| 30 | + { text: '全流程地图', link: '/workflow/overview' }, |
| 31 | + { text: '需求与任务切片', link: '/workflow/prd-and-slicing' }, |
| 32 | + { text: '上下文工程', link: '/workflow/context-engineering' }, |
| 33 | + { text: '实现循环', link: '/workflow/implementation-loop' }, |
| 34 | + { text: '人机协作协议', link: '/workflow/handoff-protocol' } |
| 35 | + ] |
| 36 | + }, |
| 37 | + { |
| 38 | + text: 'Harness Engine', |
| 39 | + items: [ |
| 40 | + { text: 'Harness 总览', link: '/harness/overview' }, |
| 41 | + { text: '业界模式整理', link: '/harness/industry-patterns' }, |
| 42 | + { text: 'AI Coding Harness 蓝图', link: '/harness/ai-coding-harness' } |
| 43 | + ] |
| 44 | + }, |
| 45 | + { |
| 46 | + text: 'AI-Native 验收', |
| 47 | + items: [ |
| 48 | + { text: '验收总览', link: '/acceptance/ai-native-acceptance' }, |
| 49 | + { text: 'Reviewer Swarm', link: '/acceptance/reviewer-swarm' }, |
| 50 | + { text: '测试审查', link: '/acceptance/test-skeptic' }, |
| 51 | + { text: '安全红队', link: '/acceptance/security-red-team' }, |
| 52 | + { text: '证据包与人类裁决', link: '/acceptance/evidence-and-human-arbiter' } |
| 53 | + ] |
| 54 | + }, |
| 55 | + { |
| 56 | + text: '工程质量', |
| 57 | + items: [ |
| 58 | + { text: '架构与治理', link: '/quality/architecture' }, |
| 59 | + { text: '测试策略', link: '/quality/testing-strategy' }, |
| 60 | + { text: '安全与权限', link: '/quality/security' }, |
| 61 | + { text: '发布、灰度与回滚', link: '/quality/release' }, |
| 62 | + { text: '可维护性', link: '/quality/maintainability' } |
| 63 | + ] |
| 64 | + }, |
| 65 | + { |
| 66 | + text: '团队落地', |
| 67 | + items: [ |
| 68 | + { text: '组织运行模型', link: '/team/operating-model' }, |
| 69 | + { text: '角色与职责', link: '/team/roles' }, |
| 70 | + { text: '度量指标', link: '/team/metrics' }, |
| 71 | + { text: '工具选型', link: '/team/tooling' } |
| 72 | + ] |
| 73 | + }, |
| 74 | + { |
| 75 | + text: '参考', |
| 76 | + items: [ |
| 77 | + { text: 'Prompt 模板库', link: '/reference/prompt-library' }, |
| 78 | + { text: 'AI Reviewer JSON 契约', link: '/reference/reviewer-contract' }, |
| 79 | + { text: '检查清单', link: '/reference/checklists' }, |
| 80 | + { text: '术语表', link: '/reference/glossary' } |
| 81 | + ] |
| 82 | + }, |
| 83 | + { |
| 84 | + text: '附录', |
| 85 | + items: [ |
| 86 | + { text: 'Harness 阅读地图', link: '/appendix/harness-reading-map' }, |
| 87 | + { text: 'Claude Code Best Practices 导读', link: '/appendix/claude-code-best-practices' }, |
| 88 | + { text: 'OpenAI Building Agents 导读', link: '/appendix/openai-building-agents-guide' }, |
| 89 | + { text: 'LangChain Harness 分层导读', link: '/appendix/langchain-framework-runtime-harness' } |
| 90 | + ] |
| 91 | + } |
| 92 | +] |
| 93 | + |
| 94 | +export default defineConfig({ |
| 95 | + base, |
| 96 | + title: 'AI Coding', |
| 97 | + description: '面向 AI-native 软件工程的全流程知识站。', |
| 98 | + cleanUrls: true, |
| 99 | + lastUpdated: true, |
| 100 | + metaChunk: true, |
| 101 | + head: [ |
| 102 | + ['link', { rel: 'icon', href: `${base}favicon.svg` }], |
| 103 | + ['meta', { name: 'theme-color', content: '#0f2f3d' }], |
| 104 | + ['meta', { property: 'og:title', content: 'AI Coding' }], |
| 105 | + ['meta', { property: 'og:description', content: '面向 AI-native 软件工程的全流程知识站。' }] |
| 106 | + ], |
| 107 | + themeConfig: { |
| 108 | + logo: '/favicon.svg', |
| 109 | + siteTitle: 'AI Coding', |
| 110 | + nav, |
| 111 | + sidebar, |
| 112 | + search: { provider: 'local' }, |
| 113 | + editLink: { |
| 114 | + pattern: 'https://github.com/limecloud/aicoding/edit/main/docs/:path', |
| 115 | + text: '在 GitHub 编辑本页' |
| 116 | + }, |
| 117 | + footer: { |
| 118 | + message: 'AI-native software engineering playbook for teams that ship with coding agents.', |
| 119 | + copyright: 'Released for discussion and implementation.' |
| 120 | + }, |
| 121 | + socialLinks: [ |
| 122 | + { icon: 'github', link: 'https://github.com/limecloud/aicoding' } |
| 123 | + ] |
| 124 | + }, |
| 125 | + markdown: { |
| 126 | + lineNumbers: true, |
| 127 | + config(md) { |
| 128 | + const defaultFence = md.renderer.rules.fence |
| 129 | + md.renderer.rules.fence = (tokens, idx, options, env, self) => { |
| 130 | + const token = tokens[idx] |
| 131 | + const language = token.info.trim().split(/\s+/)[0] |
| 132 | + |
| 133 | + if (language === 'mermaid') { |
| 134 | + const encoded = encodeURIComponent(token.content) |
| 135 | + return `<ClientOnly><MermaidDiagram code="${encoded}" /></ClientOnly>` |
| 136 | + } |
| 137 | + |
| 138 | + return defaultFence |
| 139 | + ? defaultFence(tokens, idx, options, env, self) |
| 140 | + : self.renderToken(tokens, idx, options) |
| 141 | + } |
| 142 | + } |
| 143 | + } |
| 144 | +}) |
0 commit comments