-
Notifications
You must be signed in to change notification settings - Fork 15
/
vuepress.config.ts
98 lines (95 loc) · 2.39 KB
/
vuepress.config.ts
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
import { readdirSync } from 'node:fs'
import { defaultTheme, defineUserConfig } from 'vuepress'
import markdownItAttrs from 'markdown-it-attrs'
import markdownItBracketedSpans from 'markdown-it-bracketed-spans'
import markdownItInsert from 'markdown-it-ins'
import markdownItImsize from 'markdown-it-imsize'
import markdownItMultimdTable from 'markdown-it-multimd-table'
import { path } from '@vuepress/utils'
import { registerComponentsPlugin } from '@vuepress/plugin-register-components'
import { collapsibleTopLevelSidebar } from 'vuepress-collapsible-toplevel-sidebar'
// ['Part0', 'Part1', 'Part2', ...]
const parts = readdirSync('./docs/parts/')
.map(partName => partName.replace(/.md$/g, ''))
const config = defineUserConfig({
lang: 'zh-CN',
title: 'GAHT Guide',
description: 'GAHT Guide for transfemale',
head: [
['link', { rel: 'icon', href: '/favicon.ico' }],
['link', { rel: 'stylesheet', href: '/custom.css', type: 'text/css' }],
],
theme: defaultTheme({
logo: '/logo.png',
repo: 'BBleae/hrt-book',
repoLabel: 'GitHub',
docsRepo: 'BBleae/hrt-book',
docsDir: 'docs',
docsBranch: 'main',
editLink: true,
editLinkText: '编辑本页面',
contributors: true,
contributorsText: '贡献者',
lastUpdated: false,
themePlugins: {
externalLinkIcon: true,
},
sidebar: {
'/cafe/': [
'HOME',
'DONATE',
'Estradiol',
'Progesterone',
'Anti-Androgens',
'HairLoss',
'SERMs',
'Miscellaneous',
'RESOURCES',
'CONTACT',
],
'/': [''],
},
navbar: [
{
text: '首页',
link: '/',
},
{
text: '目录',
link: '/menu/',
},
{
text: 'Cafe',
link: '/cafe/',
},
{
text: '工具',
link: '/tools/',
},
{
text: '链接',
link: '/link/',
},
{
text: 'Credits',
link: '/credits/',
},
],
}),
extendsMarkdown: (md) => {
md.use(markdownItBracketedSpans)
md.use(markdownItAttrs)
md.use(markdownItInsert)
md.use(markdownItImsize)
md.use(markdownItMultimdTable, {
rowspan: true,
})
},
plugins: [
registerComponentsPlugin({
componentsDir: path.join(__dirname, './components'),
}),
collapsibleTopLevelSidebar('/parts/', parts),
],
})
export default config