123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- import { defineConfig } from 'vitepress'
- import { CustomAvatars } from './constant'
- // @ts-ignore
- import { getChangelogAndContributors } from 'vitepress-plugin-changelog'
- export default defineConfig({
- base: '/efe-docs/',
- outDir: './efe-docs',
- title: '文档',
- description: "剑鱼前端团队内部文档 - 探索前端世界,从文档开始",
- lang: 'zh-CN',
- srcExclude: [
- 'dist/**',
- 'node_modules/**',
- 'plugins/**',
- 'scripts/**',
- ],
- // sitemap: {
- // hostname: './'
- // },
- rewrites: {
- 'apps/(.*)/README.md': 'apps/(.*)/index.md',
- 'core/(.*)/README.md': 'core/(.*)/index.md',
- 'packages/(.*)/README.md': 'packages/(.*)/index.md',
- 'data/(.*)/README.md': 'data/(.*)/index.md',
- 'docs/:name.md': ':name.md',
- 'docs/:group/:name.md': ':group/:name.md',
- 'docs/:group/:group2/:name.md': ':group/:group2/:name.md',
- },
- themeConfig: {
- siteTitle: ' ',
- logo: {
- light: 'https://cdn-ali.jianyu360.com/images/index/logo_main.png',
- dark: 'https://cdn-ali.jianyu360.com/images/index/logo_white.png'
- },
- nav: [
- { text: '指南', link: '/guide/getting-started' },
- {
- text: '项目文档',
- items: [
- { text: 'bigmember_pc', link: '/apps/bigmember_pc/' },
- { text: '🚧 jy-pc', link: '/apps/jy-pc/' },
- { text: 'mobile', link: '/apps/mobile/' },
- { text: 'work-bench', link: '/apps/work-bench/' },
- ]
- },
- {
- text: 'data',
- items: [
- { text: '🚧 @jy/api', link: '/data/api/' },
- { text: '@jy/data-models', link: '/data/data-models/' }
- ]
- },
- {
- text: 'packages',
- items: [
- { text: '@jy/emiiter', link: '/core/emitter/' },
- { text: '@jy/plugin-login-auth', link: '/plugin-login-auth/introduce' },
- { text: '@jy/vue-anti', link: '/packages/vue-anti/' },
- { text: '@jy/work-bench-frame', link: '/packages/work-bench-frame/' },
- { text: '@jianyu/cli', link: '/cli/' },
- ]
- },
- {
- text: '知识库',
- items: [
- { text: 'monorepo', link: '/monorepo/introduce' },
- { text: '常见问题自检清单', link: '/check/' },
- { text: '通用埋点相关', link: '/track/index-new' },
- { text: 'go模板相关', link: '/go/go安装应用' }
- ]
- },
- { text: '资源', link: '/resource' },
- { text: '参与建设', link: '/to-do/' }
- ],
- sidebar: {
- '/guide/': {
- base: '/guide/',
- items: [
- {
- text: '开发指南',
- base: '/guide/',
- items: [
- { text: '项目简介', link: 'introduce' },
- { text: '环境配置', link: 'development' },
- { text: '快速上手', link: 'getting-started' },
- ]
- },
- {
- text: '代码风格',
- base: '/guide/style/',
- items: [
- { text: '前言', link: 'introduce' },
- { text: '文件命名规则', link: 'naming' },
- { text: '通用规则', link: 'base' },
- { text: 'HTML', link: 'html' },
- { text: 'CSS', link: 'css' },
- { text: 'JS', link: 'js' },
- { text: 'Vue', link: 'vue' },
- ]
- },
- ]
- },
- '/go/': {
- base: '/go/',
- items: [
- {
- text: 'go模板相关指南',
- base: '/go/',
- items: [
- { text: '安装应用', link: 'go安装应用' },
- { text: '常用语法', link: 'go模板常用语法' },
- ]
- }
- ]
- },
- '/data/data-models/': {
- base: '/data/data-models/',
- items: [
- {
- text: '业务模型',
- base: '/data/data-models/modules/',
- items: [
- { text: 'article 详情页', link: '/article/' },
- { text: 'quick-monitor<br>项目、企业、业主监控', link: '/quick-monitor/' },
- ]
- }
- ]
- },
- '/apps/bigmember_pc/': {
- base: '/apps/bigmember_pc/',
- items: [
- {
- text: '业务维护文档',
- base: '/apps/bigmember_pc/src/',
- items: [
- {
- text: 'article-content<br>详情页',
- link: '/views/article-content/composables/'
- }
- ]
- },
- {
- text: 'composables',
- base: '/apps/bigmember_pc/src/composables/',
- items: [
- { text: 'down-project-report<br>下载项目报告', link: '/down-project-report/' },
- { text: 'quick-join-bid<br>参标,取消参标相关', link: '/quick-join-bid/' },
- { text: 'quick-monitor<br>项目、企业、业主监控', link: '/quick-monitor/' }
- ]
- }
- ]
- },
- '/apps/mobile/': {
- base: '/apps/mobile/',
- items: [
- {
- text: 'composables',
- base: '/apps/mobile/src/composables/',
- items: [
- { text: 'quick-monitor<br>项目、企业、业主监控', link: '/quick-monitor/' }
- ]
- }
- ]
- }
- },
- outline: {
- label: '目录'
- },
- search: {
- provider: 'local'
- },
- lastUpdated: {
- text: '上次更新',
- formatOptions: {
- dateStyle: 'full',
- timeStyle: 'medium'
- }
- },
- editLink: {
- pattern: 'https://jygit.jydev.jianyu360.cn/jianyu/web/src/docs/docs/:path',
- text: '编辑'
- },
- docFooter: {
- prev: '返回',
- next: '继续阅读'
- }
- },
- async transformPageData ({ relativePath }) {
- const { contributors, changelog } = await getChangelogAndContributors(relativePath)
- const CustomContributors = contributors.map(contributor => {
- contributor.avatar = `https://jygit.jydev.jianyu360.cn/avatars/${CustomAvatars[contributor.name]}`
- return contributor
- })
- return {
- CommitData: {
- contributors: CustomContributors,
- changelog,
- commitURL: 'https://jygit.jydev.jianyu360.cn/jianyu/web/commit/',
- title: '更新记录'
- }
- }
- },
- // vite: {
- // build: {
- // rollupOptions: {
- // external: ["vue/server-renderer", "vue"]
- // }
- // }
- // }
- })
|