-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvuepress.config.ts
More file actions
88 lines (87 loc) · 2.1 KB
/
Copy pathvuepress.config.ts
File metadata and controls
88 lines (87 loc) · 2.1 KB
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
import {
copyrightHtmlStr,
footerHtmlStr,
navbarConfig,
pkg,
sidebarConfig,
siteBase,
siteDescription,
siteDevPort,
siteHead,
siteLogo,
siteOrigin,
siteTitle,
} from '.vuepress/config'
import { OPEN_SOURCE_ADDRESS, OPEN_SOURCE_AUTHOR } from '@142vip/open-source'
import {
createVipViteBuildPlugin,
defineVipVuepressConfig,
getVipHopeTheme,
handleImportCodePath,
} from '@142vip/vuepress'
/**
* VuePress 站点配置
*
* 对齐 `@142vip/vuepress`(见 core-x `packages/vuepress`):
* - `locales` / `lang` / `bundler` 由 `defineVipVuepressConfig` 默认注入
* - `author` / `docsDir` / `docsBranch` / `contributors` 由 `getVipHopeTheme` 默认注入
* - 大文档站 chunk 告警用包内 `createVipViteBuildPlugin`
* - 文档路由依赖各 md 的 frontmatter `permalink`
* - 侧边栏 `.md` 链接经 `resolveSidebarPermalinks` 对齐 permalink
*/
export default defineVipVuepressConfig({
base: siteBase,
title: siteTitle,
description: siteDescription,
port: siteDevPort,
pagePatterns: [
'docs/**/*.md',
'!node_modules',
'!.vuepress',
'!code/**',
],
head: siteHead,
plugins: [
createVipViteBuildPlugin(),
],
markdown: {
importCode: {
handleImportPath: handleImportCodePath([
['@code', 'code'],
['@algorithm', 'code/algorithm'],
['~', ''],
]),
},
headers: {
level: [2, 3, 4],
},
},
theme: getVipHopeTheme({
navbar: navbarConfig,
sidebar: sidebarConfig,
navbarLayout: {
start: ['Brand'],
center: ['Links'],
end: ['Language', 'Outlook', 'Repo', 'Search'],
},
logo: siteLogo,
hostname: siteOrigin,
// 页脚
footer: footerHtmlStr,
// 版权
copyright: copyrightHtmlStr,
// 仓库 142vip/JavaScriptCollection
repo: `${OPEN_SOURCE_ADDRESS.GITHUB_ORGANIZATION_NAME}/${pkg.name}`,
docsRepo: OPEN_SOURCE_ADDRESS.GITHUB_REPO_JSC,
plugins: {
watermark: {
enabled: true,
watermarkOptions: {
content: OPEN_SOURCE_AUTHOR.name,
},
},
},
}),
}, {
appBuildLog: { version: pkg.version },
})