import { defineConfig } from 'vitepress' import { projects } from '../data/projects' /** * 门户站构建配置 * * SITE_BASE 由构建参数注入: * - /www/ 过渡形态:挂在已有网关的 /www/ 路径下(没有独立域名时用) * - / 独立域名形态:站点独占域名根路径 * 两者内容完全同源,只有资源前缀与路由前缀不同,所以用构建参数而不是改代码。 */ const SITE_BASE = process.env.SITE_BASE ?? '/www/' /** 代码仓组织(雪羊科技企业仓) */ const ORG_URL = process.env.ORG_URL ?? 'https://gitee.com/snowgoat' /** 各项目的文档站地址(按项目 id 覆盖) */ const DOCS_URL: Record = { iotlcm: 'http://open.5iot.com:5051/docs/', } export default defineConfig({ srcDir: './pages', base: SITE_BASE, title: '雪羊科技开源', description: '雪羊科技开源项目门户:物联网卡管理、DTU 设备管理、中后台开发框架', lang: 'zh-CN', cleanUrls: true, lastUpdated: false, head: [ ['link', { rel: 'icon', type: 'image/svg+xml', href: `${SITE_BASE}favicon.svg` }], ], themeConfig: { siteTitle: '雪羊科技', logo: { src: '/snowgoat-logo.png', alt: '雪羊科技' }, nav: [ { text: '首页', link: '/' }, { text: '产品功能', link: '/#features' }, { text: '核心能力', link: '/#core' }, { text: '界面预览', link: '/#preview' }, // activeMatch:进入任一项目详情页时「项目」保持高亮 { text: '项目', link: '/projects/', activeMatch: '^/projects/' }, { text: '官方文档', link: '/#docs' }, { text: '关于', link: '/about' }, ], sidebar: { '/projects/': [ { text: '项目', collapsed: false, items: projects.map((p) => ({ text: p.name, link: p.page })), }, ], '/guide/': [ { text: '门户', collapsed: false, items: [{ text: '门户部署', link: '/guide/portal-deploy' }], }, ], }, socialLinks: [ { icon: 'github', link: ORG_URL }, ], footer: { message: '雪羊科技开源 · Apache-2.0', copyright: 'Copyright © 雪羊科技', }, search: { provider: 'local', }, outline: { level: [2, 3], label: '本页目录', }, docFooter: { prev: '上一页', next: '下一页', }, }, })