/
theme.ts
209 lines (184 loc) · 4.79 KB
/
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
208
209
import { hopeTheme } from "vuepress-theme-hope";
import { enNavbar, zhNavbar } from "./navbar/index.js";
import { enSidebar, zhSidebar } from "./sidebar/index.js";
const hostname =
process.env.HOSTNAME || "https://vuepress-theme-hope-docs-demo.netlify.app";
export default hopeTheme({
hostname,
author: {
name: "Mr.Hope",
url: "https://mrhope.site",
},
iconAssets: "iconfont",
logo: "/logo.svg",
repo: "vuepress-theme-hope/vuepress-theme-hope",
docsDir: "demo/theme-docs/src",
pageInfo: ["Author", "Original", "Date", "Category", "Tag", "ReadingTime"],
locales: {
"/": {
// navbar
navbar: enNavbar,
// sidebar
sidebar: enSidebar,
footer: "Default footer",
displayFooter: true,
metaLocales: {
editLink: "Edit this page on GitHub",
},
},
/**
* Chinese locale config
*/
"/zh/": {
// navbar
navbar: zhNavbar,
// sidebar
sidebar: zhSidebar,
footer: "默认页脚",
displayFooter: true,
// page meta
metaLocales: {
editLink: "在 GitHub 上编辑此页",
},
},
},
encrypt: {
config: {
"/demo/encrypt.html": ["1234"],
"/zh/demo/encrypt.html": ["1234"],
},
},
plugins: {
// If you don’t need comment feature, you can remove following option
// The following config is for demo ONLY, if you need comment feature, please generate and use your own config, see comment plugin documentation for details.
// To avoid disturbing the theme developer and consuming his resources, please DO NOT use the following config directly in your production environment!!!!!
comment: {
/**
* Using Giscus
*/
// provider: "Giscus",
// repo: "vuepress-theme-hope/giscus-discussions",
// repoId: "R_kgDOG_Pt2A",
// category: "Announcements",
// categoryId: "DIC_kwDOG_Pt2M4COD69",
/**
* Using Twikoo
*/
// provider: "Twikoo",
// envId: "https://twikoo.ccknbc.vercel.app",
/**
* Using Waline
*/
provider: "Waline",
serverURL: "https://vuepress-theme-hope-comment.vercel.app",
},
// Disable features you don’t want here
mdEnhance: {
align: true,
attrs: true,
chart: true,
codetabs: true,
container: true,
demo: true,
echarts: true,
figure: true,
flowchart: true,
gfm: true,
imgLazyload: true,
imgSize: true,
include: true,
katex: true,
mark: true,
mermaid: true,
playground: {
presets: ["ts", "vue"],
},
presentation: {
plugins: ["highlight", "math", "search", "notes", "zoom"],
},
stylize: [
{
matcher: "Recommended",
replacer: ({ tag }) => {
if (tag === "em")
return {
tag: "Badge",
attrs: { type: "tip" },
content: "Recommended",
};
},
},
],
sub: true,
sup: true,
tabs: true,
vPre: true,
vuePlayground: true,
},
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",
},
{
src: "/assets/icon/guide-monochrome.png",
sizes: "192x192",
purpose: "monochrome",
type: "image/png",
},
],
},
],
},
},
seo:
hostname === "https://vuepress-theme-hope.github.io"
? {}
: { canonical: "https://vuepress-theme-hope.github.io/docs-demo/" },
},
});