Skip to content

Commit d2b4a4d

Browse files
committed
ci: 文档构建配置修改
1 parent 4a8ef06 commit d2b4a4d

File tree

2 files changed

+146
-58
lines changed

2 files changed

+146
-58
lines changed

docs/.vuepress/config.js

Lines changed: 136 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,147 @@
22
* @see https://vuepress.vuejs.org/zh/
33
*/
44
module.exports = {
5-
port: "4000",
6-
dest: "dist",
7-
base: "/java-tutorial/",
8-
title: "JAVA-TUTORIAL",
9-
description: "Java 教程",
10-
head: [["link", {rel: "icon", href: `/favicon.ico`}]],
5+
port: '4000',
6+
dest: 'dist',
7+
base: '/java-tutorial/',
8+
title: 'JAVA-TUTORIAL',
9+
description: 'Java 教程',
10+
head: [['link', { rel: 'icon', href: `/favicon.ico` }]],
1111
markdown: {
1212
externalLinks: {
13-
target: "_blank", rel: "noopener noreferrer"
14-
}
13+
target: '_blank',
14+
rel: 'noopener noreferrer',
15+
},
1516
},
1617
themeConfig: {
17-
logo: "images/dunwu-logo-100.png",
18-
repo: "dunwu/java-tutorial",
19-
repoLabel: "Github",
20-
docsDir: "docs",
21-
docsBranch: "master",
18+
logo: 'https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo-200.png',
19+
repo: 'dunwu/java-tutorial',
20+
repoLabel: 'Github',
21+
docsDir: 'docs',
22+
docsBranch: 'master',
2223
editLinks: true,
2324
smoothScroll: true,
2425
locales: {
25-
"/": {
26-
label: "简体中文", selectText: "Languages", editLinkText: "帮助我们改善此页面!", lastUpdated: "上次更新", nav: [{
27-
text: "工具", link: "/javatool/", items: [{
28-
text: "构建", link: "/javatool/build/"
29-
}, {
30-
text: "IDE", link: "/javatool/ide/"
31-
}, {
32-
text: "监控", link: "/javatool/monitor/"
33-
}]
34-
}, {
35-
text: "JavaEE", link: "/javaee/"
36-
}, {
37-
text: "✨ Java系列", ariaLabel: "Java", items: [{
38-
text: "Java 教程 📚", link: "https://dunwu.github.io/java-tutorial/", target: "_blank", rel: ""
39-
}, {
40-
text: "JavaCore 教程 📚", link: "https://dunwu.github.io/javacore/", target: "_blank", rel: ""
41-
}, {
42-
text: "JavaTech 教程 📚", link: "https://dunwu.github.io/javatech/", target: "_blank", rel: ""
43-
}, {
44-
text: "Spring 教程 📚", link: "https://dunwu.github.io/spring-tutorial/", target: "_blank", rel: ""
45-
}, {
46-
text: "Spring Boot 教程 📚", link: "https://dunwu.github.io/spring-boot-tutorial/", target: "_blank", rel: ""
47-
}]
48-
}, {
49-
text: "🎯 博客", link: "https://github.com/dunwu/blog", target: "_blank", rel: ""
50-
}], sidebar: "auto", sidebarDepth: 2
51-
}
52-
}
26+
'/': {
27+
label: '简体中文',
28+
selectText: 'Languages',
29+
editLinkText: '帮助我们改善此页面!',
30+
lastUpdated: '上次更新',
31+
nav: [
32+
{
33+
text: '工具',
34+
link: '/javatool/',
35+
items: [
36+
{
37+
text: '构建',
38+
link: '/javatool/build/',
39+
},
40+
{
41+
text: 'IDE',
42+
link: '/javatool/ide/',
43+
},
44+
{
45+
text: '监控',
46+
link: '/javatool/monitor/',
47+
},
48+
],
49+
},
50+
{
51+
text: 'JavaEE',
52+
link: '/javaee/',
53+
},
54+
{
55+
text: '✨ Java系列',
56+
ariaLabel: 'Java',
57+
items: [
58+
{
59+
text: 'Java 教程 📚',
60+
link: 'https://dunwu.github.io/java-tutorial/',
61+
target: '_blank',
62+
rel: '',
63+
},
64+
{
65+
text: 'JavaCore 教程 📚',
66+
link: 'https://dunwu.github.io/javacore/',
67+
target: '_blank',
68+
rel: '',
69+
},
70+
{
71+
text: 'JavaTech 教程 📚',
72+
link: 'https://dunwu.github.io/javatech/',
73+
target: '_blank',
74+
rel: '',
75+
},
76+
{
77+
text: 'Spring 教程 📚',
78+
link: 'https://dunwu.github.io/spring-tutorial/',
79+
target: '_blank',
80+
rel: '',
81+
},
82+
{
83+
text: 'Spring Boot 教程 📚',
84+
link: 'https://dunwu.github.io/spring-boot-tutorial/',
85+
target: '_blank',
86+
rel: '',
87+
},
88+
],
89+
},
90+
{
91+
text: '🎯 博客',
92+
link: 'https://github.com/dunwu/blog',
93+
target: '_blank',
94+
rel: '',
95+
},
96+
],
97+
sidebar: 'auto',
98+
sidebarDepth: 2,
99+
},
100+
},
53101
},
54-
plugins: [["@vuepress/active-header-links", {
55-
sidebarLinkSelector: ".sidebar-link", headerAnchorSelector: ".header-anchor"
56-
}], ["@vuepress/back-to-top", true], ["@vuepress/pwa", {
57-
serviceWorker: true, updatePopup: true
58-
}], ["@vuepress/medium-zoom", true], ["container", {
59-
type: "vue", before: '<pre class="vue-container"><code>', after: "</code></pre>"
60-
}], ["container", {
61-
type: "upgrade", before: info => `<UpgradePath title="${info}">`, after: "</UpgradePath>"
62-
}], ["flowchart"]]
63-
};
102+
plugins: [
103+
[
104+
'@vuepress/active-header-links',
105+
{
106+
sidebarLinkSelector: '.sidebar-link',
107+
headerAnchorSelector: '.header-anchor',
108+
},
109+
],
110+
['@vuepress/back-to-top', true],
111+
[
112+
'@vuepress/pwa',
113+
{
114+
serviceWorker: true,
115+
updatePopup: true,
116+
},
117+
],
118+
[
119+
'@vuepress/last-updated',
120+
{
121+
transformer: (timestamp, lang) => {
122+
// 不要忘了安装 moment
123+
const moment = require('moment')
124+
moment.locale(lang)
125+
return moment(timestamp).fromNow()
126+
},
127+
},
128+
],
129+
['@vuepress/medium-zoom', true],
130+
[
131+
'container',
132+
{
133+
type: 'vue',
134+
before: '<pre class="vue-container"><code>',
135+
after: '</code></pre>',
136+
},
137+
],
138+
[
139+
'container',
140+
{
141+
type: 'upgrade',
142+
before: (info) => `<UpgradePath title="${info}">`,
143+
after: '</UpgradePath>',
144+
},
145+
],
146+
['flowchart'],
147+
],
148+
}

docs/package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@
1212
"view-info": "vuepress view-info ./ --temp .temp"
1313
},
1414
"devDependencies": {
15-
"@vuepress/plugin-active-header-links": "^1.5.2",
16-
"@vuepress/plugin-back-to-top": "^1.5.0",
17-
"@vuepress/plugin-medium-zoom": "^1.5.0",
18-
"@vuepress/plugin-pwa": "^1.5.0",
19-
"@vuepress/theme-vue": "^1.5.0",
20-
"markdownlint-cli": "^0.23.1",
15+
"@vuepress/plugin-active-header-links": "^1.8.2",
16+
"@vuepress/plugin-back-to-top": "^1.8.2",
17+
"@vuepress/plugin-medium-zoom": "^1.8.2",
18+
"@vuepress/plugin-pwa": "^1.8.2",
19+
"@vuepress/theme-vue": "^1.8.2",
20+
"markdownlint-cli": "^0.25.0",
2121
"markdownlint-rule-emphasis-style": "^1.0.1",
2222
"rimraf": "^3.0.1",
2323
"vue-toasted": "^1.1.25",
24-
"vuepress": "^1.5.0",
24+
"vuepress": "^1.8.2",
2525
"vuepress-plugin-flowchart": "^1.4.2"
26+
},
27+
"dependencies": {
28+
"moment": "^2.29.1"
2629
}
2730
}

0 commit comments

Comments
 (0)