Skip to content

Commit e14c9d1

Browse files
committed
docs: 使用 vuepress-theme-vdoing,并整理文档
1 parent bb458a5 commit e14c9d1

File tree

141 files changed

+1779
-604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+1779
-604
lines changed

README.md

Lines changed: 132 additions & 114 deletions
Large diffs are not rendered by default.

docs/.vuepress/config.js

Lines changed: 184 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,208 @@
1-
/**
2-
* @see https://vuepress.vuejs.org/zh/
3-
*/
1+
const baiduCode = require('./config/baiduCode.js') // 百度统计hm码
2+
const htmlModules = require('./config/htmlModules.js')
3+
44
module.exports = {
55
port: '4000',
6-
dest: 'dist',
7-
base: '/java-tutorial/',
6+
dest: 'docs/.temp',
7+
base: '/java-tutorial/', // 默认'/'。如果你想将你的网站部署到如 https://foo.github.io/bar/,那么 base 应该被设置成 "/bar/",(否则页面将失去样式等文件)
88
title: 'JAVA-TUTORIAL',
9-
description: 'Java 教程',
10-
head: [['link', { rel: 'icon', href: `/favicon.ico` }]],
11-
markdown: {
12-
externalLinks: {
13-
target: '_blank',
14-
rel: 'noopener noreferrer',
15-
},
16-
},
9+
description: '☕ java-tutorial 是一个 Java 教程,汇集一个老司机在 Java 领域的十年积累。',
10+
theme: 'vdoing', // 使用依赖包主题
11+
// theme: require.resolve('../../vdoing'), // 使用本地主题
12+
head: [
13+
// 注入到页面<head> 中的标签,格式[tagName, { attrName: attrValue }, innerHTML?]
14+
['link', { rel: 'icon', href: '/img/favicon.ico' }], //favicons,资源放在public文件夹
15+
['meta', { name: 'keywords', content: 'vuepress,theme,blog,vdoing' }],
16+
['meta', { name: 'theme-color', content: '#11a8cd' }] // 移动浏览器主题颜色
17+
],
18+
19+
// 主题配置
1720
themeConfig: {
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',
23-
editLinks: true,
24-
smoothScroll: true,
25-
locales: {
26-
'/': {
27-
label: '简体中文',
28-
selectText: 'Languages',
29-
editLinkText: '帮助我们改善此页面!',
30-
lastUpdated: '上次更新',
31-
nav: [
32-
{
33-
text: 'JavaEE',
34-
link: '/javaee/',
35-
},
36-
{
37-
text: '框架',
38-
link: '/framework/',
39-
},
40-
{
41-
text: '缓存',
42-
link: '/cache/',
43-
},
44-
{
45-
text: '消息队列',
46-
link: '/mq/',
47-
},
48-
{
49-
text: 'LIB库',
50-
link: '/lib/',
51-
},
52-
{
53-
text: '微服务',
54-
link: '/microservice/',
55-
},
56-
{
57-
text: '安全',
58-
link: '/security/',
59-
},
60-
{
61-
text: '测试',
62-
link: '/test/',
63-
},
64-
{
65-
text: '服务器',
66-
link: '/server/',
67-
},
68-
{
69-
text: '工具',
70-
link: '/tool/',
71-
items: [
72-
{
73-
text: '构建',
74-
link: '/tool/build/',
75-
},
76-
{
77-
text: 'IDE',
78-
link: '/tool/ide/',
79-
},
80-
{
81-
text: '监控',
82-
link: '/tool/monitor/',
83-
},
84-
],
85-
},
86-
{
87-
text: '✨ Java系列',
88-
ariaLabel: 'Java',
89-
items: [
90-
{
91-
text: 'Java 教程 📚',
92-
link: 'https://dunwu.github.io/java-tutorial/',
93-
target: '_blank',
94-
rel: '',
95-
},
96-
{
97-
text: 'JavaCore 教程 📚',
98-
link: 'https://dunwu.github.io/javacore/',
99-
target: '_blank',
100-
rel: '',
101-
},
102-
{
103-
text: 'Spring 教程 📚',
104-
link: 'https://dunwu.github.io/spring-tutorial/',
105-
target: '_blank',
106-
rel: '',
107-
},
108-
{
109-
text: 'Spring Boot 教程 📚',
110-
link: 'https://dunwu.github.io/spring-boot-tutorial/',
111-
target: '_blank',
112-
rel: '',
113-
},
114-
],
115-
},
116-
{
117-
text: '🎯 博客',
118-
link: 'https://github.com/dunwu/blog',
119-
target: '_blank',
120-
rel: '',
121-
},
122-
],
123-
sidebar: 'auto',
124-
sidebarDepth: 2,
21+
nav: [
22+
{ text: '首页', link: '/' },
23+
{ text: 'JavaEE', link: '/01.JavaEE/' },
24+
{
25+
text: 'Java软件',
26+
link: '/02.Java软件/',
27+
items: [
28+
{ text: 'Java构建', link: '/02.Java软件/01.Java构建/' },
29+
{ text: 'Java IDE', link: '/02.Java软件/02.JavaIDE/' },
30+
{ text: 'Java服务器', link: '/02.Java软件/03.Java服务器/' },
31+
{ text: 'Java监控诊断', link: '/02.Java软件/04.Java监控诊断/' }
32+
]
33+
},
34+
{
35+
text: 'Java工具',
36+
link: '/03.Java工具/',
37+
items: [
38+
{ text: 'Java序列化工具', link: '/03.Java工具/01.Java序列化工具/' },
39+
{ text: 'JavaBean工具', link: '/03.Java工具/02.JavaBean工具/' },
40+
{ text: 'Java模板引擎', link: '/03.Java工具/03.Java模板引擎/' },
41+
{ text: 'Java测试工具', link: '/03.Java工具/04.Java测试工具/' },
42+
{ text: '其他', link: '/03.Java工具/05.其他Java工具/' }
43+
]
12544
},
45+
{ text: 'Java框架', link: '/04.Java框架/' },
46+
{ text: 'Java中间件', link: '/05.Java中间件/' },
47+
{
48+
text: '✨ Java系列',
49+
ariaLabel: 'Java',
50+
items: [
51+
{ text: 'Java 教程 📚', link: 'https://dunwu.github.io/java-tutorial/', target: '_blank' },
52+
{ text: 'JavaCore 教程 📚', link: 'https://dunwu.github.io/javacore/', target: '_blank' }
53+
]
54+
}
55+
],
56+
sidebarDepth: 2, // 侧边栏显示深度,默认1,最大2(显示到h3标题)
57+
logo: 'https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo-200.png', // 导航栏logo
58+
repo: 'dunwu/java-tutorial', // 导航栏右侧生成Github链接
59+
searchMaxSuggestions: 10, // 搜索结果显示最大数
60+
lastUpdated: '上次更新', // 更新的时间,及前缀文字 string | boolean (取值为git提交时间)
61+
62+
docsDir: 'docs', // 编辑的文件夹
63+
editLinks: true, // 编辑链接
64+
editLinkText: '编辑',
65+
66+
// 以下配置是Vdoing主题改动的和新增的配置
67+
sidebar: { mode: 'structuring', collapsable: false }, // 侧边栏 'structuring' | { mode: 'structuring', collapsable: Boolean} | 'auto' | 自定义 温馨提示:目录页数据依赖于结构化的侧边栏数据,如果你不设置为'structuring',将无法使用目录页
68+
69+
// sidebarOpen: false, // 初始状态是否打开侧边栏,默认true
70+
updateBar: {
71+
// 最近更新栏
72+
showToArticle: false // 显示到文章页底部,默认true
73+
// moreArticle: '/archives' // “更多文章”跳转的页面,默认'/archives'
74+
},
75+
// titleBadge: false, // 文章标题前的图标是否显示,默认true
76+
// titleBadgeIcons: [ // 文章标题前图标的地址,默认主题内置图标
77+
// '图标地址1',
78+
// '图标地址2'
79+
// ],
80+
// bodyBgImg: [
81+
// 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175828.jpeg',
82+
// 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175845.jpeg',
83+
// 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175846.jpeg'
84+
// ], // body背景大图,默认无。 单张图片 String || 多张图片 Array, 多张图片时每隔15秒换一张。
85+
86+
// categoryText: '随笔', // 碎片化文章(_posts文件夹的文章)预设生成的分类值,默认'随笔'
87+
88+
// contentBgStyle: 1,
89+
90+
category: false, // 是否打开分类功能,默认true。 如打开,会做的事情有:1. 自动生成的frontmatter包含分类字段 2.页面中显示与分类相关的信息和模块 3.自动生成分类页面(在@pages文件夹)。如关闭,则反之。
91+
tag: false, // 是否打开标签功能,默认true。 如打开,会做的事情有:1. 自动生成的frontmatter包含标签字段 2.页面中显示与标签相关的信息和模块 3.自动生成标签页面(在@pages文件夹)。如关闭,则反之。
92+
archive: true, // 是否打开归档功能,默认true。 如打开,会做的事情有:1.自动生成归档页面(在@pages文件夹)。如关闭,则反之。
93+
94+
author: {
95+
// 文章默认的作者信息,可在md文件中单独配置此信息 String | {name: String, href: String}
96+
name: 'dunwu', // 必需
97+
href: 'https://github.com/dunwu' // 可选的
98+
},
99+
social: {
100+
// 社交图标,显示于博主信息栏和页脚栏
101+
// iconfontCssFile: '//at.alicdn.com/t/font_1678482_u4nrnp8xp6g.css', // 可选,阿里图标库在线css文件地址,对于主题没有的图标可自由添加
102+
icons: [
103+
{
104+
iconClass: 'icon-youjian',
105+
title: '发邮件',
106+
link: 'mailto:forbreak@163.com'
107+
},
108+
{
109+
iconClass: 'icon-github',
110+
title: 'GitHub',
111+
link: 'https://github.com/dunwu'
112+
}
113+
]
126114
},
115+
footer: {
116+
// 页脚信息
117+
createYear: 2019, // 博客创建年份
118+
copyrightInfo: '钝悟(dunwu) | MIT License' // 博客版权信息,支持a标签
119+
},
120+
htmlModules
127121
},
122+
123+
// 插件
128124
plugins: [
125+
// [require('./plugins/love-me'), { // 鼠标点击爱心特效
126+
// color: '#11a8cd', // 爱心颜色,默认随机色
127+
// excludeClassName: 'theme-vdoing-content' // 要排除元素的class, 默认空''
128+
// }],
129+
130+
['fulltext-search'], // 全文搜索
131+
132+
// ['thirdparty-search', { // 可以添加第三方搜索链接的搜索框(原官方搜索框的参数仍可用)
133+
// thirdparty: [ // 可选,默认 []
134+
// {
135+
// title: '在GitHub中搜索',
136+
// frontUrl: 'https://github.com/search?q=', // 搜索链接的前面部分
137+
// behindUrl: '' // 搜索链接的后面部分,可选,默认 ''
138+
// },
139+
// {
140+
// title: '在npm中搜索',
141+
// frontUrl: 'https://www.npmjs.com/search?q=',
142+
// },
143+
// {
144+
// title: '在Bing中搜索',
145+
// frontUrl: 'https://cn.bing.com/search?q='
146+
// }
147+
// ]
148+
// }],
149+
129150
[
130-
'@vuepress/active-header-links',
151+
'vuepress-plugin-baidu-tongji', // 百度统计
131152
{
132-
sidebarLinkSelector: '.sidebar-link',
133-
headerAnchorSelector: '.header-anchor',
134-
},
153+
hm: baiduCode || '01293bffa6c3962016c08ba685c79d78'
154+
}
135155
],
136-
['@vuepress/back-to-top', true],
156+
137157
[
138-
'@vuepress/pwa',
158+
'one-click-copy',
139159
{
140-
serviceWorker: true,
141-
updatePopup: true,
142-
},
160+
// 代码块复制按钮
161+
copySelector: ['div[class*="language-"] pre', 'div[class*="aside-code"] aside'], // String or Array
162+
copyMessage: '复制成功', // default is 'Copy successfully and then paste it for use.'
163+
duration: 1000, // prompt message display time.
164+
showInMobile: false // whether to display on the mobile side, default: false.
165+
}
143166
],
144167
[
145-
'@vuepress/last-updated',
168+
'demo-block',
146169
{
147-
transformer: (timestamp, lang) => {
148-
// 不要忘了安装 moment
149-
const moment = require('moment')
150-
moment.locale(lang)
151-
return moment(timestamp).fromNow()
152-
},
153-
},
170+
// demo演示模块 https://github.com/xiguaxigua/vuepress-plugin-demo-block
171+
settings: {
172+
// jsLib: ['http://xxx'], // 在线示例(jsfiddle, codepen)中的js依赖
173+
// cssLib: ['http://xxx'], // 在线示例中的css依赖
174+
// vue: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js', // 在线示例中的vue依赖
175+
jsfiddle: false, // 是否显示 jsfiddle 链接
176+
codepen: true, // 是否显示 codepen 链接
177+
horizontal: false // 是否展示为横向样式
178+
}
179+
}
154180
],
155-
['@vuepress/medium-zoom', true],
156181
[
157-
'container',
182+
'vuepress-plugin-zooming', // 放大图片
158183
{
159-
type: 'vue',
160-
before: '<pre class="vue-container"><code>',
161-
after: '</code></pre>',
162-
},
184+
selector: '.theme-vdoing-content img:not(.no-zoom)',
185+
options: {
186+
bgColor: 'rgba(0,0,0,0.6)'
187+
}
188+
}
163189
],
164190
[
165-
'container',
191+
'@vuepress/last-updated', // "上次更新"时间格式
166192
{
167-
type: 'upgrade',
168-
before: (info) => `<UpgradePath title="${info}">`,
169-
after: '</UpgradePath>',
170-
},
171-
],
172-
['flowchart'],
193+
transformer: (timestamp, lang) => {
194+
const dayjs = require('dayjs') // https://day.js.org/
195+
return dayjs(timestamp).format('YYYY/MM/DD, HH:mm:ss')
196+
}
197+
}
198+
]
173199
],
200+
201+
markdown: {
202+
// lineNumbers: true,
203+
extractHeaders: ['h2', 'h3', 'h4', 'h5', 'h6'] // 提取标题到侧边栏的级别,默认['h2', 'h3']
204+
},
205+
206+
// 监听文件变化并重新构建
207+
extraWatchFiles: ['.vuepress/config.js', '.vuepress/config/htmlModules.js']
174208
}

docs/.vuepress/config/baiduCode.js

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

0 commit comments

Comments
 (0)