Skip to content

配置

本文档的 vitepress 配置

仅供参考 , 更多配置请查看官方文档

import { defineConfig } from 'vitepress'
import { version } from '../../package.json'

export default defineConfig({
  title: 'electron-vue3-quiet',
  description:
    '一个持续更新,坚持使用最新技术的,比较激进的桌面端脚手架! (●ˇ∀ˇ●) ,持续施工中 ....',
  base: '/electron-vue3-quiet-doc/',
  lang: 'en-US',
  head: [['link', { rel: 'icon', href: 'favicon.ico' }]],
  markdown: {
    lineNumbers: true
  },
  lastUpdated: true,
  appearance: true,
  themeConfig: {
    siteTitle: 'electron-vue3-quiet',
    logo: '/favicon.ico',
    lastUpdatedText: '最后更新时间',
    footer: {
      message: 'Released under the MIT License.',
      copyright: 'Copyright © 2022-08-present 安静'
    },
    // docFooter: {
    //   prev: '上一页',
    //   next: '下一页'
    // },
    nav: nav(),
    socialLinks: [
      { icon: 'github', link: 'https://github.com/TaiAiAc/electron-vue3-quiet' }
    ],
    sidebar: {
      '/about/': [
        {
          text: '关于',
          items: [
            { text: '文档配置', link: '/about/' },
            { text: '性能优化', link: '/about/optimization' }
          ]
        }
      ],
      ...introduceSidebar()
    }
  }
})

function nav() {
  return [
    {
      text: '指引',
      link: '/introduce/project',
      activeMatch: '/introduce|main|renderer|config|builder/'
    },
    {
      text: '关于',
      link: '/about/',
      activeMatch: '/about/'
    },
    {
      text: '相关文档',
      items: [
        {
          text: 'vue',
          link: 'https://staging-cn.vuejs.org/'
        },
        {
          text: 'electron',
          link: 'https://www.electronjs.org/'
        },
        {
          text: 'vite',
          link: 'https://cn.vitejs.dev/'
        },
        {
          text: 'rollup',
          link: 'https://www.rollupjs.com/'
        },
        {
          text: 'electron-builder',
          link: 'https://www.electron.build/'
        },
        {
          text: 'vue-router',
          link: 'https://router.vuejs.org/zh/'
        },
        {
          text: 'pinia',
          link: 'https://pinia.vuejs.org/'
        },
        {
          text: 'vueuse',
          link: 'https://vueuse.org/'
        }
      ]
    },
    {
      text: version,
      items: [
        {
          text: '文档仓库地址',
          link: 'https://github.com/TaiAiAc/electron-vue3-quiet-doc.git'
        },
        {
          text: '友情连接/sky',
          link: 'https://zh-sky.gitee.io/electron-vue-template-doc/'
        }
      ]
    }
  ]
}

function introduceSidebar() {
  const commonRoute = [
    {
      text: '介绍',
      items: [
        { text: '项目介绍', link: '/introduce/project' },
        { text: '快速上手', link: '/introduce/introduction' },
        { text: '目录', link: '/introduce/catalogue' },
        { text: '从其他项目迁移', link: '/introduce/migration' }
      ]
    },
    {
      text: '主进程',
      items: [
        { text: '介绍', link: '/main/' },
        { text: 'app', link: '/main/app' },
        { text: '路径', link: '/main/path' },
        { text: '托盘', link: '/main/tray' },
        { text: '菜单', link: '/main/menu' },
        { text: '窗口', link: '/main/browserWindow' },
        { text: '预加载', link: '/main/preload' },
        { text: 'ipc通信', link: '/main/ipc' },
        { text: 'typeorm', link: '/main/typeorm' },
        { text: '其他', link: '/main/rests' }
      ]
    },
    {
      text: '渲染进程',
      items: []
    },
    {
      text: '配置',
      items: []
    },
    {
      text: '构建',
      items: []
    }
  ]

  return {
    '/introduce/': commonRoute,
    '/main/': commonRoute,
    '/renderer/': commonRoute,
    '/config/': commonRoute,
    '/builder/': commonRoute
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159

Released under the MIT License.