import { defineConfig } from 'vitepress' // 部署到子路径时,构建前设置环境变量即可: // DOCS_BASE=/ny-exam-docs/ npm run docs:build const base = process.env.DOCS_BASE || '/' // 输出目录。默认 .vitepress/dist;若需要保留旧产物(或环境禁止删除目录), // 可用 DOCS_OUT=.vitepress/dist2 npm run docs:build 输出到新目录。 const outDir = process.env.DOCS_OUT || '.vitepress/dist' export default defineConfig({ base, outDir, lang: 'zh-CN', title: 'NY 问卷考试系统数据平台', description: '基于 PHP 8 + 卷王(SurveyKing)社区版开放 API 的零依赖考试数据统计平台', cleanUrls: true, ignoreDeadLinks: true, head: [ ['meta', { name: 'theme-color', content: '#2563eb' }], ['meta', { name: 'referrer', content: 'no-referrer' }] ], themeConfig: { // outlineTitle: '本页目录', outline: [2, 3], lastUpdated: { text: '最后更新于' }, search: { provider: 'local', options: { locales: { zh: { translations: { button: { buttonText: '搜索文档', buttonAriaLabel: '搜索文档' }, modal: { noResultsText: '未找到相关结果', resetButtonTitle: '清除查询条件', footer: { selectText: '选择', navigateText: '切换', closeText: '关闭' } } } } } } }, nav: [ { text: '首页', link: '/' }, { text: '使用指南', link: '/guide/introduction', activeMatch: '/guide/' }, { text: '安全', link: '/security/', activeMatch: '/security/' }, { text: '开发', link: '/dev/architecture', activeMatch: '/dev/' } ], sidebar: { '/guide/': [ { text: '开始', items: [ { text: '平台简介', link: '/guide/introduction' }, { text: '环境要求与部署', link: '/guide/install' }, { text: '快速上手', link: '/guide/quickstart' } ] }, { text: '核心功能', items: [ { text: '系统设置', link: '/guide/settings' }, { text: '名单管理', link: '/guide/roster' }, { text: '成绩明细与统计口径', link: '/guide/scores' }, { text: '试卷设置(满分/合格率/免考)', link: '/guide/project-config' }, { text: '快照、趋势与异常检测', link: '/guide/snapshot' }, { text: '导出与打印', link: '/guide/export-print' } ] }, { text: '其他页面', items: [ { text: '数据看板', link: '/guide/dashboard' }, { text: '随机抽取', link: '/guide/draw' } ] }, { text: '帮助', items: [ { text: '常见问题', link: '/guide/faq' } ] } ], '/security/': [ { text: '安全', items: [ { text: '安全总览', link: '/security/' }, { text: '部署加固清单', link: '/security/hardening' } ] } ], '/dev/': [ { text: '开发', items: [ { text: '架构与目录', link: '/dev/architecture' }, { text: '接口一览', link: '/dev/api' }, { text: '数据存储(SQLite)', link: '/dev/database' }, { text: '测试', link: '/dev/testing' } ] } ] }, socialLinks: [], footer: { message: '基于 PHP 8 + 卷王(SurveyKing)社区版开放 API 构建,零第三方运行依赖。', copyright: 'Copyright © NY 问卷考试系统数据平台' }, docFooter: { prev: '上一页', next: '下一页' }, returnToTopLabel: '回到顶部', sidebarMenuLabel: '菜单', darkModeSwitchLabel: '主题', lightModeSwitchTitle: '切换到浅色模式', darkModeSwitchTitle: '切换到深色模式' } })