Skip to content

Commit b87822f

Browse files
committed
style: update github action and index page
1 parent eb967d7 commit b87822f

File tree

2 files changed

+82
-103
lines changed

2 files changed

+82
-103
lines changed

.github/workflows/prettier.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
with:
1616
ref: ${{ github.head_ref }}
1717

18-
- name: Prettify code
19-
uses: creyD/prettier_action@v3.2
18+
- name: Prettify
19+
uses: creyD/prettier_action@v3.3
2020
with:
21-
prettier_options: --write **/*.{html,js,md}
22-
commit_message: 'style: prettify code and document'
21+
prettier_options: --write **/*.{md}
22+
commit_message: 'style: prettify code or document'
2323
env:
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

index.html

+78-99
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,62 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<title>JVM 底层原理最全总结</title>
6-
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7-
<meta
8-
name="keywords"
9-
content="doc,docs,doocs,documentation,github,gitee,jvm,yanglbme"
10-
/>
11-
<meta
12-
name="description"
13-
content="JVM 底层原理最全总结,项目维护者:杨立滨"
14-
/>
15-
<meta
16-
name="viewport"
17-
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
18-
/>
19-
<link
20-
rel="stylesheet"
21-
href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css"
22-
/>
23-
<link
24-
rel="stylesheet"
25-
href="//cdn.jsdelivr.net/npm/[email protected]/dist/style.css"
26-
/>
27-
<link
28-
rel="icon"
29-
type="image/png"
30-
sizes="32x32"
31-
href="images/favicon-32x32.png"
32-
/>
33-
<link
34-
rel="icon"
35-
type="image/png"
36-
sizes="16x16"
37-
href="images/favicon-16x16.png"
38-
/>
39-
</head>
40-
<body>
41-
<div id="app">本系列知识由 Doocs 开源社区总结发布</div>
42-
<script>
43-
window.$docsify = {
44-
name: "jvm",
45-
repo: "doocs/jvm",
46-
maxLevel: 3,
47-
auto2top: true,
48-
loadSidebar: "docs/README.md",
49-
search: ["/"],
50-
pagination: {
51-
previousText: "上一章节",
52-
nextText: "下一章节",
53-
},
54-
darkMode: {
55-
light: {
56-
toggleBtnBg: "#42b983",
57-
},
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<title>JVM 底层原理最全总结</title>
7+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8+
<meta name="keywords" content="doc,docs,doocs,documentation,github,gitee,jvm,yanglbme" />
9+
<meta name="description" content="JVM 底层原理最全总结,项目维护者:杨立滨" />
10+
<meta name="viewport"
11+
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
12+
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css" />
13+
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/[email protected]/dist/style.css" />
14+
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png" />
15+
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png" />
16+
</head>
17+
18+
<body>
19+
<div id="app">本系列知识由 Doocs 开源社区总结发布</div>
20+
<script>
21+
window.$docsify = {
22+
name: "jvm",
23+
repo: "doocs/jvm",
24+
maxLevel: 3,
25+
auto2top: true,
26+
loadSidebar: "docs/README.md",
27+
search: ["/"],
28+
pagination: {
29+
previousText: "上一章节",
30+
nextText: "下一章节",
31+
},
32+
darkMode: {
33+
light: {
34+
toggleBtnBg: "#42b983",
5835
},
59-
plugins: [
60-
function (hook, vm) {
61-
hook.beforeEach(function (content) {
62-
const en = vm.route.file.indexOf("README_EN") > -1;
63-
if (/githubusercontent\.com/.test(vm.route.file)) {
64-
url = vm.route.file
65-
.replace("raw.githubusercontent.com", "github.com")
66-
.replace(/\/main/, "/blob/main");
67-
} else {
68-
url = "https://github.com/doocs/jvm/blob/main/" + vm.route.file;
69-
}
36+
},
37+
plugins: [
38+
function (hook, vm) {
39+
hook.beforeEach(function (content) {
40+
const en = vm.route.file.indexOf("README_EN") > -1;
41+
if (/githubusercontent\.com/.test(vm.route.file)) {
42+
url = vm.route.file
43+
.replace("raw.githubusercontent.com", "github.com")
44+
.replace(/\/main/, "/blob/main");
45+
} else {
46+
url = "https://github.com/doocs/jvm/blob/main/" + vm.route.file;
47+
}
7048

71-
const github = `[GitHub](${url})`;
72-
const gitee = `[Gitee](${url.replace("github", "gitee")})`;
49+
const github = `[GitHub](${url})`;
50+
const gitee = `[Gitee](${url.replace("github", "gitee")})`;
7351

74-
const editHtml = en
75-
? `:memo: Edit on ${github} / ${gitee}\n`
76-
: `:memo: 在 ${github} / ${gitee} 编辑\n`;
52+
const editHtml = en
53+
? `:memo: Edit on ${github} / ${gitee}\n`
54+
: `:memo: 在 ${github} / ${gitee} 编辑\n`;
7755

78-
if (vm.route.path == "/") {
79-
return editHtml + content;
80-
}
81-
const subscription = `
56+
if (vm.route.path == "/") {
57+
return editHtml + content;
58+
}
59+
const subscription = `
8260
## 公众号
8361
8462
[Doocs](https://github.com/doocs) 技术社区旗下唯一公众号「**Doocs开源社区**」​,欢迎扫码关注,**专注分享技术领域相关知识及业内最新资讯**。当然,也可以加我个人微信(备注:GitHub),拉你进技术交流群。
@@ -105,28 +83,29 @@
10583
![](./images/jvm-pdf.png)
10684
10785
`;
108-
return editHtml + content + `\n` + subscription;
109-
});
86+
return editHtml + content + `\n` + subscription;
87+
});
88+
89+
hook.afterEach(function (html) {
90+
const footer = [
91+
"<footer>",
92+
'<span>Copyright © 2018-2021 <a href="https://github.com/doocs" target="_blank">Doocs</a>. All rights reserved.',
93+
"</footer>",
94+
].join("");
95+
return html + footer;
96+
});
97+
},
98+
],
99+
};
100+
</script>
101+
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
102+
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-java.min.js"></script>
103+
<script src="//cdn.jsdelivr.net/npm/docsify-copy-code"></script>
104+
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.js"></script>
105+
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/emoji.js"></script>
106+
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/zoom-image.js"></script>
107+
<script src="//cdn.jsdelivr.net/npm/[email protected]/dist/index.js"></script>
108+
<script src="//cdn.jsdelivr.net/npm/docsify-pagination/dist/docsify-pagination.min.js"></script>
109+
</body>
110110

111-
hook.afterEach(function (html) {
112-
const footer = [
113-
"<footer>",
114-
'<span>Copyright © 2018-2020 <a href="https://github.com/doocs" target="_blank">Doocs</a>. All rights reserved.',
115-
"</footer>",
116-
].join("");
117-
return html + footer;
118-
});
119-
},
120-
],
121-
};
122-
</script>
123-
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
124-
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-java.min.js"></script>
125-
<script src="//cdn.jsdelivr.net/npm/docsify-copy-code"></script>
126-
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.js"></script>
127-
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/emoji.js"></script>
128-
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/zoom-image.js"></script>
129-
<script src="//cdn.jsdelivr.net/npm/[email protected]/dist/index.js"></script>
130-
<script src="//cdn.jsdelivr.net/npm/docsify-pagination/dist/docsify-pagination.min.js"></script>
131-
</body>
132-
</html>
111+
</html>

0 commit comments

Comments
 (0)