-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvuepress.theme.ts
207 lines (184 loc) · 5.29 KB
/
vuepress.theme.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
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
import { hopeTheme } from 'vuepress-theme-hope'
import * as navbar from './navbar'
import * as sidebar from './sidebar'
const author = {
zh: {
name: '星轨工作室',
url: 'https://gitlab.com/starry-orbit-studio',
},
en: {
name: 'Starry Orbit Studio',
url: 'https://gitlab.com/starry-orbit-studio',
},
}
const cc = 'by-nc-sa/4.0'
const license = {
zh: {
type: '知识共享许可协议',
name: '知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议',
description: `本作品采用<a rel="license" href="http://creativecommons.org/licenses/${cc}/">{license}</a>进行许可。`,
},
en: {
type: 'Creative Commons License',
name: 'Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License',
description: `This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/${cc}/">{license}</a>.`,
},
}
// prettier-ignore
const copyright = (locale: keyof typeof license) => {
const year = new Date().getFullYear()
let builder = ''
builder += `<a rel="license" href="http://creativecommons.org/licenses/${cc}/"><img alt="${license[locale].name}" style="border-width:0" src="https://licensebuttons.net/l/${cc}/80x15.png" /></a>`
builder += '<br />'
builder += '<a normal href="https://beian.miit.gov.cn/" target="_blank">京ICP备2022016928号-2</a>'
builder += ' | '
builder += `Copyright © ${year} <a normal rel="author" href="${author[locale].url}">${author[locale].name}</a>`
builder += '<br />'
builder += license[locale].description.replace('{license}', license[locale].name)
return builder
}
export default hopeTheme(
{
hostname: 'https://demo.github.io',
iconAssets: 'fontawesome-with-brands',
logo: '/logo.png',
repo: 'https://gitlab.com/starry-orbit-studio/extreme-starry/esdn',
docsRepo: 'https://gitlab.com/starry-orbit-studio/extreme-starry/esdn',
docsBranch: 'master',
docsDir: 'docs',
locales: {
/**
* Chinese locale config
*/
'/': {
// navbar
navbar: navbar.zh,
author: author.zh,
// sidebar
sidebar: sidebar.zh,
displayFooter: true,
copyright: copyright('zh'),
// page meta
metaLocales: {
editLink: '在 GitLab 上编辑此页',
},
},
'/en/': {
// navbar
navbar: navbar.en,
author: author.en,
// sidebar
sidebar: sidebar.en,
displayFooter: true,
copyright: copyright('en'),
metaLocales: {
editLink: 'Edit this page on GitLab',
},
},
},
plugins: {
// All features are enabled for demo, only preserve features you need here
mdEnhance: {
gfm: true,
alert: true,
hint: true,
checkLinks: {
status: 'always',
},
tabs: true,
codetabs: true,
align: true,
attrs: true,
sup: true,
sub: true,
footnote: true,
mark: true,
figure: true,
imgLazyload: true,
imgMark: true,
imgSize: true,
obsidianImgSize: true,
tasklist: true,
component: true,
chart: false,
echarts: false,
mermaid: true,
revealJs: false,
delay: 200,
},
components: {
components: [
// 'ArtPlayer',
'Badge',
'BiliBili',
// 'CodePen',
'FontIcon',
'PDF',
// 'Replit',
'Share',
// 'StackBlitz',
'SiteInfo',
// 'VidStack',
// 'XiGua',
],
},
// uncomment these if you want a pwa
// pwa: {
// favicon: "/favicon.ico",
// cacheHTML: true,
// cachePic: true,
// appendBase: true,
// apple: {
// icon: "/assets/icon/apple-icon-152.png",
// statusBarColor: "black",
// },
// msTile: {
// image: "/assets/icon/ms-icon-144.png",
// color: "#ffffff",
// },
// manifest: {
// icons: [
// {
// src: "/assets/icon/chrome-mask-512.png",
// sizes: "512x512",
// purpose: "maskable",
// type: "image/png",
// },
// {
// src: "/assets/icon/chrome-mask-192.png",
// sizes: "192x192",
// purpose: "maskable",
// type: "image/png",
// },
// {
// src: "/assets/icon/chrome-512.png",
// sizes: "512x512",
// type: "image/png",
// },
// {
// src: "/assets/icon/chrome-192.png",
// sizes: "192x192",
// type: "image/png",
// },
// ],
// shortcuts: [
// {
// name: "Demo",
// short_name: "Demo",
// url: "/demo/",
// icons: [
// {
// src: "/assets/icon/guide-maskable.png",
// sizes: "192x192",
// purpose: "maskable",
// type: "image/png",
// },
// ],
// },
// ],
// },
// },
},
},
{ custom: true },
)