-
Notifications
You must be signed in to change notification settings - Fork 2k
/
Copy paththeme.ts
274 lines (241 loc) · 7.55 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
import { hopeTheme } from "vuepress-theme-hope";
import navbar from "./navbar.js";
import sidebar from "./sidebar.js";
export default hopeTheme({
hostname: "https://javabetter.cn",
// 网站图标
author: {
name: "沉默王二",
url: "/about-the-author/",
},
// 阿里妈妈图标的前缀
iconPrefix: "iconfont icon-",
logo: "https://cdn.tobebetterjavaer.com/tobebetterjavaer/images/logo-02.png",
// Git 仓库和编辑链接
repo: "https://github.com/itwanger/toBeBetterJavaer",
repoLabel: "GitHub",
docsDir: "docs/src/",
// 以前的默认仓库分支名,方便提交 pr 和 issue
docsBranch: "master",
breadcrumb: false,
// 全屏按钮
fullscreen: true,
// 在深色模式,浅色模式和自动之间切换 (默认)
darkmode: "switch",
// 导航栏
navbar,
// 侧边栏
sidebar,
// 页脚支持
footer: '<a href="https://beian.miit.gov.cn/" target="_blank">豫ICP备2021038026号-4</a>'
+'<img src="https://cdn.tobebetterjavaer.com/tobebetterjavaer/images/beian.png" height="15px" width="15px" />'
+'<a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=41030502000411">'
+'<span>豫公网安备 41030502000411号</span>'
+'</a>',
displayFooter: true,
// 加密
encrypt: {
config: {
// 这只会加密 config/page.html
"/nice-article/itmind/ideapjazjczxjhmzcmyjjhcxgxz.html": ["1110", "5210"],
"/nice-article/itmind/webstormjhmwebstormwdzsjhmxbxt.html": ["1110", "5210"],
"/nice-article/itmind/sublimetextzcmpjazjcqckyxbxt.html": ["1110", "5210"],
},
},
// 提示文字
encryptLocales: {
placeholder: "微信搜‘沉默王二’回复‘密码’获取口令",
/**
* Passwrod error hint
*/
errorHint: "哈哈,别调戏人家啦,按规则来嘛",
},
// 多语言配置
metaLocales: {
editLink: "在 GitHub 上编辑此页",
},
// 文章信息,可以填入数组,数组的顺序是各条目显示的顺序
pageInfo: ["Author", "Original", "Date", "Category", "Tag", "Word","ReadingTime"],
blog: {
// 个人介绍页地址
intro: "/about-the-author/",
sidebarDisplay: "mobile",
// 博主头像
avatar: "/assets/icon/itwanger-282.png",
// 座右铭
description:"没有什么使我停留——除了目的,纵然岸旁有玫瑰、有绿荫、有宁静的港湾,我是不系之舟。",
medias: {
Zhihu: "https://www.zhihu.com/people/cmower",
CSDN: "https://blog.csdn.net/qing_gee",
Github: "https://github.com/itwanger",
Gitee: "https://gitee.com/itwanger",
},
},
// 如果想要实时查看任何改变,启用它。注: 这对更新性能有很大负面影响
// hotReload: true,
// 在这里配置主题提供的插件
plugins: {
blog: true,
// 注意: 仅用于测试! 你必须自行生成并在生产环境中使用自己的评论服务
comment: {
provider: "Giscus",
repo :"itwanger/tobebetterjavaer-giscus",
repoId:"R_kgDOHBJssg",
category:"Announcements",
categoryId:"DIC_kwDOHBJsss4COJOx",
},
components: {
components: ["Badge", "VPCard"],
},
// 此处开启了很多功能用于演示,你应仅保留用到的功能。
mdEnhance: {
align: true,
attrs: true,
codetabs: true,
component: true,
demo: true,
// 启用 figure,为图像添加描述
figure: true,
// 启用图片懒加载
imgLazyload: true,
// 启用图片大小
imgSize: true,
include: true,
mark: true,
plantuml: true,
spoiler: true,
stylize: [
{
matcher: "Recommended",
replacer: ({ tag }) => {
if (tag === "em")
return {
tag: "Badge",
attrs: { type: "tip" },
content: "Recommended",
};
},
},
],
sub: true,
sup: true,
tabs: true,
// 支持任务列表
tasklist: true,
vPre: true,
// 在启用之前安装 chart.js
// chart: true,
// insert component easily
// 在启用之前安装 echarts
// echarts: true,
// 在启用之前安装 flowchart.ts
// flowchart: true,
// gfm requires mathjax-full to provide tex support
// gfm: true,
// 在启用之前安装 katex
// katex: true,
// 在启用之前安装 mathjax-full
mathjax: true,
// 在启用之前安装 mermaid
// mermaid: true,
// playground: {
// presets: ["ts", "vue"],
// },
// 在启用之前安装 reveal.js
// revealJs: {
// plugins: ["highlight", "math", "search", "notes", "zoom"],
// },
// 在启用之前安装 @vue/repl
// vuePlayground: true,
// install sandpack-vue3 before enabling it
// sandpack: true,
},
docsearch: {
appId: "O566AMFNJH",
apiKey: "d9aebea8bd1a4f1e01201464bbab255f",
indexName: "tobebetterjavaer",
locales: {
"/": {
placeholder: "搜索文档",
translations: {
button: {
buttonText: "搜索文档",
buttonAriaLabel: "搜索文档",
},
modal: {
searchBox: {
resetButtonTitle: "清除查询条件",
resetButtonAriaLabel: "清除查询条件",
cancelButtonText: "取消",
cancelButtonAriaLabel: "取消",
},
startScreen: {
recentSearchesTitle: "搜索历史",
noRecentSearchesText: "没有搜索历史",
saveRecentSearchButtonTitle: "保存至搜索历史",
removeRecentSearchButtonTitle: "从搜索历史中移除",
favoriteSearchesTitle: "收藏",
removeFavoriteSearchButtonTitle: "从收藏中移除",
},
errorScreen: {
titleText: "无法获取结果",
helpText: "你可能需要检查你的网络连接",
},
footer: {
selectText: "选择",
navigateText: "切换",
closeText: "关闭",
searchByText: "搜索提供者",
},
noResultsScreen: {
noResultsText: "无法找到相关结果",
suggestedQueryText: "你可以尝试查询",
},
},
},
},
},
},
// 如果你需要 PWA。安装 @vuepress/plugin-pwa 并取消下方注释
pwa: {
favicon: "https://cdn.tobebetterjavaer.com/tobebetterjavaer/images/favicon.ico",
cacheHTML: true,
cacheImage: 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",
},
],
},
},
},
});