Skip to content

Commit 9ef8de3

Browse files
committed
feat: 修改配置
1 parent 43c2271 commit 9ef8de3

File tree

13 files changed

+322
-223
lines changed

13 files changed

+322
-223
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"compact": false
3+
}

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ insert_final_newline = true
1919
[*.{bat, cmd}]
2020
end_of_line = crlf
2121

22-
[*.{java, gradle, groovy, kt, sh, xml}]
22+
[*.{java, gradle, groovy, kt, sh}]
2323
indent_size = 4
2424

2525
[*.md]

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node-version: [14.x]
18+
node-version: [16.x]
1919

2020
steps:
2121
# 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions

docs/.vuepress/config.js

Lines changed: 52 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,54 @@ module.exports = {
1414
['link', { rel: 'icon', href: '/img/favicon.ico' }], //favicons,资源放在public文件夹
1515
['meta', { name: 'keywords', content: 'vuepress,theme,blog,vdoing' }],
1616
['meta', { name: 'theme-color', content: '#11a8cd' }], // 移动浏览器主题颜色
17+
18+
['meta', { name: 'wwads-cn-verify', content: 'mxqWx62nfQQ9ocT4e5DzISHzOWyF4s' }], // 广告相关,你可以去掉
19+
['script', { src: 'https://cdn.wwads.cn/js/makemoney.js', type: 'text/javascript' }], // 广告相关,你可以去掉
1720
],
1821
markdown: {
1922
// lineNumbers: true,
2023
extractHeaders: ['h2', 'h3', 'h4', 'h5', 'h6'], // 提取标题到侧边栏的级别,默认['h2', 'h3']
2124
externalLinks: {
2225
target: '_blank',
23-
rel: 'noopener noreferrer',
24-
},
26+
rel: 'noopener noreferrer'
27+
}
2528
},
2629
// 主题配置
2730
themeConfig: {
2831
nav: [
32+
{ text: '首页', link: '/' },
33+
{ text: 'JavaEE', link: '/01.JavaEE/' },
2934
{
30-
text: 'JavaEE',
35+
text: 'Java软件',
36+
link: '/02.Java软件/',
3137
items: [
32-
{ text: 'JavaWeb', link: '/02.JavaEE/01.JavaWeb/' },
33-
{ text: '服务器', link: '/02.JavaEE/02.服务器/' },
34-
],
38+
{ text: 'Java构建', link: '/02.Java软件/01.Java构建/' },
39+
{ text: 'Java IDE', link: '/02.Java软件/02.JavaIDE/' },
40+
{ text: 'Java服务器', link: '/02.Java软件/03.Java服务器/' },
41+
{ text: 'Java监控诊断', link: '/02.Java软件/04.Java监控诊断/' }
42+
]
3543
},
3644
{
37-
text: 'Java软件',
38-
link: '/11.软件/',
45+
text: 'Java工具',
46+
link: '/03.Java工具/',
3947
items: [
40-
{ text: 'Java构建', link: '/11.软件/01.构建/' },
41-
{ text: 'Java IDE', link: '/11.软件/02.IDE/' },
42-
{ text: 'Java监控诊断', link: '/11.软件/03.监控诊断/' },
43-
],
48+
{ text: 'Java序列化工具', link: '/03.Java工具/01.Java序列化工具/' },
49+
{ text: 'JavaBean工具', link: '/03.Java工具/02.JavaBean工具/' },
50+
{ text: 'Java模板引擎', link: '/03.Java工具/03.Java模板引擎/' },
51+
{ text: 'Java测试工具', link: '/03.Java工具/04.Java测试工具/' },
52+
{ text: '其他', link: '/03.Java工具/05.其他Java工具/' }
53+
]
4454
},
45-
{ text: 'Java工具', link: '/12.工具/' },
46-
{ text: 'Java框架', link: '/13.框架/' },
47-
{ text: 'Java中间件', link: '/14.中间件/' },
55+
{ text: 'Java框架', link: '/04.Java框架/' },
56+
{ text: 'Java中间件', link: '/05.Java中间件/' },
4857
{
4958
text: '✨ Java系列',
5059
ariaLabel: 'Java',
5160
items: [
5261
{ text: 'Java 教程 📚', link: 'https://dunwu.github.io/java-tutorial/', target: '_blank' },
53-
{ text: 'JavaCore 教程 📚', link: 'https://dunwu.github.io/javacore/', target: '_blank' },
54-
],
55-
},
62+
{ text: 'JavaCore 教程 📚', link: 'https://dunwu.github.io/javacore/', target: '_blank' }
63+
]
64+
}
5665
],
5766
sidebarDepth: 2, // 侧边栏显示深度,默认1,最大2(显示到h3标题)
5867
logo: 'https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo.png', // 导航栏logo
@@ -65,12 +74,13 @@ module.exports = {
6574
editLinkText: '📝 帮助改善此页面!',
6675

6776
// 以下配置是Vdoing主题改动的和新增的配置
68-
sidebar: { mode: 'structuring', collapsable: false }, // 侧边栏 'structuring' | { mode: 'structuring', collapsable: Boolean} | 'auto' | 自定义 温馨提示:目录页数据依赖于结构化的侧边栏数据,如果你不设置为'structuring',将无法使用目录页
77+
sidebar: { mode: 'structuring', collapsable: true }, // 侧边栏 'structuring' | { mode: 'structuring', collapsable:
78+
// Boolean} | 'auto' | 自定义 温馨提示:目录页数据依赖于结构化的侧边栏数据,如果你不设置为'structuring',将无法使用目录页
6979

70-
// sidebarOpen: false, // 初始状态是否打开侧边栏,默认true
80+
sidebarOpen: true, // 初始状态是否打开侧边栏,默认true
7181
updateBar: {
7282
// 最近更新栏
73-
showToArticle: true, // 显示到文章页底部,默认true
83+
showToArticle: true // 显示到文章页底部,默认true
7484
// moreArticle: '/archives' // “更多文章”跳转的页面,默认'/archives'
7585
},
7686
// titleBadge: false, // 文章标题前的图标是否显示,默认true
@@ -95,7 +105,7 @@ module.exports = {
95105
author: {
96106
// 文章默认的作者信息,可在md文件中单独配置此信息 String | {name: String, href: String}
97107
name: 'dunwu', // 必需
98-
href: 'https://github.com/dunwu', // 可选的
108+
href: 'https://github.com/dunwu' // 可选的
99109
},
100110
social: {
101111
// 社交图标,显示于博主信息栏和页脚栏
@@ -104,21 +114,21 @@ module.exports = {
104114
{
105115
iconClass: 'icon-youjian',
106116
title: '发邮件',
107-
link: 'mailto:[email protected]',
117+
link: 'mailto:[email protected]'
108118
},
109119
{
110120
iconClass: 'icon-github',
111121
title: 'GitHub',
112-
link: 'https://github.com/dunwu',
113-
},
114-
],
122+
link: 'https://github.com/dunwu'
123+
}
124+
]
115125
},
116126
footer: {
117127
// 页脚信息
118128
createYear: 2019, // 博客创建年份
119-
copyrightInfo: '钝悟(dunwu) | CC-BY-SA-4.0', // 博客版权信息,支持a标签
129+
copyrightInfo: '钝悟(dunwu) | CC-BY-SA-4.0' // 博客版权信息,支持a标签
120130
},
121-
htmlModules,
131+
htmlModules
122132
},
123133

124134
// 插件
@@ -128,8 +138,8 @@ module.exports = {
128138
{
129139
// 鼠标点击爱心特效
130140
color: '#11a8cd', // 爱心颜色,默认随机色
131-
excludeClassName: 'theme-vdoing-content', // 要排除元素的class, 默认空''
132-
},
141+
excludeClassName: 'theme-vdoing-content' // 要排除元素的class, 默认空''
142+
}
133143
],
134144

135145
['fulltext-search'], // 全文搜索
@@ -159,8 +169,8 @@ module.exports = {
159169
copySelector: ['div[class*="language-"] pre', 'div[class*="aside-code"] aside'], // String or Array
160170
copyMessage: '复制成功', // default is 'Copy successfully and then paste it for use.'
161171
duration: 1000, // prompt message display time.
162-
showInMobile: false, // whether to display on the mobile side, default: false.
163-
},
172+
showInMobile: false // whether to display on the mobile side, default: false.
173+
}
164174
],
165175
[
166176
'demo-block',
@@ -172,30 +182,30 @@ module.exports = {
172182
// vue: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js', // 在线示例中的vue依赖
173183
jsfiddle: false, // 是否显示 jsfiddle 链接
174184
codepen: true, // 是否显示 codepen 链接
175-
horizontal: false, // 是否展示为横向样式
176-
},
177-
},
185+
horizontal: false // 是否展示为横向样式
186+
}
187+
}
178188
],
179189
[
180190
'vuepress-plugin-zooming', // 放大图片
181191
{
182192
selector: '.theme-vdoing-content img:not(.no-zoom)',
183193
options: {
184-
bgColor: 'rgba(0,0,0,0.6)',
185-
},
186-
},
194+
bgColor: 'rgba(0,0,0,0.6)'
195+
}
196+
}
187197
],
188198
[
189199
'@vuepress/last-updated', // "上次更新"时间格式
190200
{
191201
transformer: (timestamp, lang) => {
192202
const dayjs = require('dayjs') // https://day.js.org/
193203
return dayjs(timestamp).format('YYYY/MM/DD, HH:mm:ss')
194-
},
195-
},
196-
],
204+
}
205+
}
206+
]
197207
],
198208

199209
// 监听文件变化并重新构建
200-
extraWatchFiles: ['.vuepress/config.js', '.vuepress/config/htmlModules.js'],
210+
extraWatchFiles: ['.vuepress/config.js', '.vuepress/config/htmlModules.js']
201211
}

docs/.vuepress/config/baiduCode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = '';
1+
module.exports = ''

docs/.vuepress/config/htmlModules.js

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,37 @@
2020

2121
module.exports = {
2222
// 万维广告
23-
pageB: `
24-
<div class="wwads-cn wwads-horizontal pageB" data-id="136" style="width:100%;max-height:80px;min-height:auto;"></div>
25-
<style>
26-
.pageB img{width:80px!important;}
27-
.wwads-horizontal .wwads-text, .wwads-content .wwads-text{line-height:1;}
28-
</style>
29-
`,
23+
// pageT: `
24+
// <div class="wwads-cn wwads-horizontal page-wwads" data-id="261"></div>
25+
// <style>
26+
// .page-wwads{
27+
// width:100%!important;
28+
// min-height: 0;
29+
// margin: 0;
30+
// }
31+
// .page-wwads .wwads-img img{
32+
// width:80px!important;
33+
// }
34+
// .page-wwads .wwads-poweredby{
35+
// width: 40px;
36+
// position: absolute;
37+
// right: 25px;
38+
// bottom: 3px;
39+
// }
40+
// .wwads-content .wwads-text, .page-wwads .wwads-text{
41+
// height: 100%;
42+
// padding-top: 5px;
43+
// display: block;
44+
// }
45+
// </style>
46+
// `,
3047
windowRB: `
31-
<div class="wwads-cn wwads-vertical windowRB" data-id="136" style="max-width:160px;
48+
<div class="wwads-cn wwads-vertical windowRB" data-id="261" style="max-width:160px;
3249
min-width: auto;min-height:auto;"></div>
3350
<style>
3451
.windowRB{ padding: 0;}
3552
.windowRB .wwads-img{margin-top: 10px;}
36-
.windowRB .wwads-content{margin: 0 10px 10px 10px;}
53+
.windowRB .wwads-content{margin: 0 10px 40px 10px;}
3754
.custom-html-window-rb .close-but{
3855
display: none;
3956
}

docs/.vuepress/enhanceApp.js

Lines changed: 26 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -6,108 +6,54 @@ export default ({
66
options, // 附加到根实例的一些选项
77
router, // 当前应用的路由实例
88
siteData, // 站点元数据
9-
isServer, // 当前应用配置是处于 服务端渲染 还是 客户端
9+
isServer // 当前应用配置是处于 服务端渲染 还是 客户端
1010
}) => {
11+
1112
// 用于监控在路由变化时检查广告拦截器 (to主题使用者:你可以去掉本文件的所有代码)
1213
if (!isServer) {
1314
router.afterEach(() => {
1415
//check if wwads' fire function was blocked after document is ready with 3s timeout (waiting the ad loading)
1516
docReady(function () {
16-
// setTimeout(function () {
17-
// if (window._AdBlockInit === undefined) {
18-
// ABDetected()
19-
// }
20-
// }, 3000)
21-
})
17+
setTimeout(function () {
18+
if (window._AdBlockInit === undefined) {
19+
ABDetected();
20+
}
21+
}, 3000);
22+
});
2223

2324
// 删除事件改为隐藏事件
2425
setTimeout(() => {
25-
const pageB = document.querySelector('.pageB')
26-
if (!pageB) return
27-
const btnEl = pageB.querySelector('.wwads-hide')
26+
const pageAD = document.querySelector('.page-wwads');
27+
if (!pageAD) return;
28+
const btnEl = pageAD.querySelector('.wwads-hide');
2829
if (btnEl) {
2930
btnEl.onclick = () => {
30-
pageB.style.display = 'none'
31+
pageAD.style.display = 'none';
3132
}
3233
}
3334
// 显示广告模块
34-
pageB.style.display = 'flex'
35-
36-
integrateGitalk(router)
37-
}, 0)
35+
if (pageAD.style.display === 'none') {
36+
pageAD.style.display = 'flex';
37+
}
38+
}, 900);
3839
})
3940
}
40-
try {
41-
document && integrateGitalk(router)
42-
} catch (e) {
43-
console.error(e.message)
44-
}
4541
}
4642

43+
4744
function ABDetected() {
48-
const h =
49-
"<style>.wwads-horizontal,.wwads-vertical{background-color:#f4f8fa;padding:5px;min-height:120px;margin-top:20px;box-sizing:border-box;border-radius:3px;font-family:sans-serif;display:flex;min-width:150px;position:relative;overflow:hidden;}.wwads-horizontal{flex-wrap:wrap;justify-content:center}.wwads-vertical{flex-direction:column;align-items:center;padding-bottom:32px}.wwads-horizontal a,.wwads-vertical a{text-decoration:none}.wwads-horizontal .wwads-img,.wwads-vertical .wwads-img{margin:5px}.wwads-horizontal .wwads-content,.wwads-vertical .wwads-content{margin:5px}.wwads-horizontal .wwads-content{flex:130px}.wwads-vertical .wwads-content{margin-top:10px}.wwads-horizontal .wwads-text,.wwads-content .wwads-text{font-size:14px;line-height:1.4;color:#0e1011;-webkit-font-smoothing:antialiased}.wwads-horizontal .wwads-poweredby,.wwads-vertical .wwads-poweredby{display:block;font-size:11px;color:#a6b7bf;margin-top:1em}.wwads-vertical .wwads-poweredby{position:absolute;left:10px;bottom:10px}.wwads-horizontal .wwads-poweredby span,.wwads-vertical .wwads-poweredby span{transition:all 0.2s ease-in-out;margin-left:-1em}.wwads-horizontal .wwads-poweredby span:first-child,.wwads-vertical .wwads-poweredby span:first-child{opacity:0}.wwads-horizontal:hover .wwads-poweredby span,.wwads-vertical:hover .wwads-poweredby span{opacity:1;margin-left:0}.wwads-horizontal .wwads-hide,.wwads-vertical .wwads-hide{position:absolute;right:-23px;bottom:-23px;width:46px;height:46px;border-radius:23px;transition:all 0.3s ease-in-out;cursor:pointer;}.wwads-horizontal .wwads-hide:hover,.wwads-vertical .wwads-hide:hover{background:rgb(0 0 0 /0.05)}.wwads-horizontal .wwads-hide svg,.wwads-vertical .wwads-hide svg{position:absolute;left:10px;top:10px;fill:#a6b7bf}.wwads-horizontal .wwads-hide:hover svg,.wwads-vertical .wwads-hide:hover svg{fill:#3E4546}</style><a href='https://wwads.cn/page/whitelist-wwads' class='wwads-img' target='_blank' rel='nofollow'><img src='https://cdn.jsdelivr.net/gh/xugaoyi/image_store@master/blog/wwads.2a3pidhlh4ys.webp' width='130'></a><div class='wwads-content'><a href='https://wwads.cn/page/whitelist-wwads' class='wwads-text' target='_blank' rel='nofollow'>为了本站的长期运营,请将我们的网站加入广告拦截器的白名单,感谢您的支持!<span style='color: #11a8cd'>如何添加白名单?</span></a><a href='https://wwads.cn/page/end-user-privacy' class='wwads-poweredby' title='万维广告 ~ 让广告更优雅,且有用' target='_blank'><span>万维</span><span>广告</span></a></div><a class='wwads-hide' onclick='parentNode.remove()' title='隐藏广告'><svg xmlns='http://www.w3.org/2000/svg' width='6' height='7'><path d='M.879.672L3 2.793 5.121.672a.5.5 0 11.707.707L3.708 3.5l2.12 2.121a.5.5 0 11-.707.707l-2.12-2.12-2.122 2.12a.5.5 0 11-.707-.707l2.121-2.12L.172 1.378A.5.5 0 01.879.672z'></path></svg></a>"
50-
const wwadsEl = document.getElementsByClassName('wwads-cn')
51-
const wwadsContentEl = document.querySelector('.wwads-content')
45+
const h = "<style>.wwads-horizontal,.wwads-vertical{background-color:#f4f8fa;padding:5px;min-height:120px;margin-top:20px;box-sizing:border-box;border-radius:3px;font-family:sans-serif;display:flex;min-width:150px;position:relative;overflow:hidden;}.wwads-horizontal{flex-wrap:wrap;justify-content:center}.wwads-vertical{flex-direction:column;align-items:center;padding-bottom:32px}.wwads-horizontal a,.wwads-vertical a{text-decoration:none}.wwads-horizontal .wwads-img,.wwads-vertical .wwads-img{margin:5px}.wwads-horizontal .wwads-content,.wwads-vertical .wwads-content{margin:5px}.wwads-horizontal .wwads-content{flex:130px}.wwads-vertical .wwads-content{margin-top:10px}.wwads-horizontal .wwads-text,.wwads-content .wwads-text{font-size:14px;line-height:1.4;color:#0e1011;-webkit-font-smoothing:antialiased}.wwads-horizontal .wwads-poweredby,.wwads-vertical .wwads-poweredby{display:block;font-size:11px;color:#a6b7bf;margin-top:1em}.wwads-vertical .wwads-poweredby{position:absolute;left:10px;bottom:10px}.wwads-horizontal .wwads-poweredby span,.wwads-vertical .wwads-poweredby span{transition:all 0.2s ease-in-out;margin-left:-1em}.wwads-horizontal .wwads-poweredby span:first-child,.wwads-vertical .wwads-poweredby span:first-child{opacity:0}.wwads-horizontal:hover .wwads-poweredby span,.wwads-vertical:hover .wwads-poweredby span{opacity:1;margin-left:0}.wwads-horizontal .wwads-hide,.wwads-vertical .wwads-hide{position:absolute;right:-23px;bottom:-23px;width:46px;height:46px;border-radius:23px;transition:all 0.3s ease-in-out;cursor:pointer;}.wwads-horizontal .wwads-hide:hover,.wwads-vertical .wwads-hide:hover{background:rgb(0 0 0 /0.05)}.wwads-horizontal .wwads-hide svg,.wwads-vertical .wwads-hide svg{position:absolute;left:10px;top:10px;fill:#a6b7bf}.wwads-horizontal .wwads-hide:hover svg,.wwads-vertical .wwads-hide:hover svg{fill:#3E4546}</style><a href='https://wwads.cn/page/whitelist-wwads' class='wwads-img' target='_blank' rel='nofollow'><img src='https://fastly.jsdelivr.net/gh/xugaoyi/image_store@master/blog/wwads.2a3pidhlh4ys.webp' width='130'></a><div class='wwads-content'><a href='https://wwads.cn/page/whitelist-wwads' class='wwads-text' target='_blank' rel='nofollow'>为了本站的长期运营,请将我们的网站加入广告拦截器的白名单,感谢您的支持!<span style='color: #11a8cd'>如何添加白名单?</span></a><a href='https://wwads.cn/page/end-user-privacy' class='wwads-poweredby' title='万维广告 ~ 让广告更优雅,且有用' target='_blank'><span>广告</span></a></div><a class='wwads-hide' onclick='parentNode.remove()' title='隐藏广告'><svg xmlns='http://www.w3.org/2000/svg' width='6' height='7'><path d='M.879.672L3 2.793 5.121.672a.5.5 0 11.707.707L3.708 3.5l2.12 2.121a.5.5 0 11-.707.707l-2.12-2.12-2.122 2.12a.5.5 0 11-.707-.707l2.121-2.12L.172 1.378A.5.5 0 01.879.672z'></path></svg></a>";
46+
const wwadsEl = document.getElementsByClassName("wwads-cn");
47+
const wwadsContentEl = document.querySelector('.wwads-content');
5248
if (wwadsEl[0] && !wwadsContentEl) {
53-
wwadsEl[0].innerHTML = h
49+
wwadsEl[0].innerHTML = h;
5450
}
55-
}
51+
};
5652

5753
//check document ready
5854
function docReady(t) {
59-
'complete' === document.readyState || 'interactive' === document.readyState
60-
? setTimeout(t, 1)
61-
: document.addEventListener('DOMContentLoaded', t)
62-
}
63-
64-
// 集成 Gitalk 评论插件
65-
function integrateGitalk(router) {
66-
const linkGitalk = document.createElement('link')
67-
linkGitalk.href = 'https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css'
68-
linkGitalk.rel = 'stylesheet'
69-
document.body.appendChild(linkGitalk)
70-
const scriptGitalk = document.createElement('script')
71-
scriptGitalk.src = 'https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js'
72-
document.body.appendChild(scriptGitalk)
73-
74-
router.afterEach((to) => {
75-
if (scriptGitalk.onload) {
76-
loadGitalk(to)
77-
} else {
78-
scriptGitalk.onload = () => {
79-
loadGitalk(to)
80-
}
81-
}
82-
})
83-
84-
function loadGitalk(to) {
85-
let commentsContainer = document.getElementById('gitalk-container')
86-
if (!commentsContainer) {
87-
commentsContainer = document.createElement('div')
88-
commentsContainer.id = 'gitalk-container'
89-
commentsContainer.classList.add('content')
90-
}
91-
const $page = document.querySelector('.page')
92-
if ($page) {
93-
$page.appendChild(commentsContainer)
94-
if (typeof Gitalk !== 'undefined' && Gitalk instanceof Function) {
95-
renderGitalk(to.fullPath)
96-
}
97-
}
98-
}
99-
function renderGitalk(fullPath) {
100-
console.info(fullPath)
101-
const gitalk = new Gitalk({
102-
clientID: '1ba9606d18aec7c070d4',
103-
clientSecret: '57c7e5e3611840efe117ccbad4d87fb60cb364cc', // come from github development
104-
repo: 'java-tutorial',
105-
owner: 'dunwu',
106-
admin: ['dunwu'],
107-
id: 'comment',
108-
distractionFreeMode: false,
109-
language: 'zh-CN',
110-
})
111-
gitalk.render('gitalk-container')
112-
}
55+
"complete" === document.readyState ||
56+
"interactive" === document.readyState
57+
? setTimeout(t, 1)
58+
: document.addEventListener("DOMContentLoaded", t);
11359
}

0 commit comments

Comments
 (0)