Skip to content

Commit 2966837

Browse files
committed
docs: 整理文档
1 parent 106f003 commit 2966837

File tree

121 files changed

+1662
-1195
lines changed

Some content is hidden

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

121 files changed

+1662
-1195
lines changed

README.md

Lines changed: 98 additions & 78 deletions
Large diffs are not rendered by default.

assets/redis/Redis.xmind

212 KB
Binary file not shown.

docs/.vuepress/config.js

Lines changed: 161 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,199 @@
1-
/**
2-
* @see https://vuepress.vuejs.org/zh/
3-
*/
1+
const htmlModules = require('./config/htmlModules.js')
2+
43
module.exports = {
54
port: '4000',
6-
dest: 'dist',
7-
base: '/db-tutorial/',
5+
dest: 'docs/.temp',
6+
base: '/db-tutorial/', // 默认'/'。如果你想将你的网站部署到如 https://foo.github.io/bar/,那么 base 应该被设置成 "/bar/",(否则页面将失去样式等文件)
87
title: 'DB-TUTORIAL',
9-
description: '数据库教程',
10-
head: [['link', { rel: 'icon', href: `/favicon.ico` }]],
8+
description: '☕ db-tutorial 是一个数据库教程。',
9+
theme: 'vdoing', // 使用依赖包主题
10+
// theme: require.resolve('../../vdoing'), // 使用本地主题
11+
head: [
12+
// 注入到页面<head> 中的标签,格式[tagName, { attrName: attrValue }, innerHTML?]
13+
['link', { rel: 'icon', href: '/img/favicon.ico' }], //favicons,资源放在public文件夹
14+
['meta', { name: 'keywords', content: 'vuepress,theme,blog,vdoing' }],
15+
['meta', { name: 'theme-color', content: '#11a8cd' }], // 移动浏览器主题颜色
16+
],
1117
markdown: {
18+
// lineNumbers: true,
19+
extractHeaders: ['h2', 'h3', 'h4', 'h5', 'h6'], // 提取标题到侧边栏的级别,默认['h2', 'h3']
1220
externalLinks: {
1321
target: '_blank',
1422
rel: 'noopener noreferrer',
1523
},
1624
},
25+
// 主题配置
1726
themeConfig: {
18-
logo: 'https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo-200.png',
19-
repo: 'dunwu/db-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: 'SQL',
34-
link: '/sql/',
35-
},
36-
{
37-
text: 'NOSQL',
38-
link: '/nosql/',
39-
},
40-
{
41-
text: 'Mysql',
42-
link: '/sql/mysql/',
43-
},
44-
{
45-
text: 'Redis',
46-
link: '/nosql/redis/',
47-
},
48-
{
49-
text: 'Elasticsearch',
50-
link: '/nosql/elasticsearch/',
51-
},
52-
{
53-
text: 'MongoDB',
54-
link: '/nosql/mongodb/',
55-
},
56-
{
57-
text: '🎯 博客',
58-
link: 'https://github.com/dunwu/blog',
59-
target: '_blank',
60-
rel: '',
61-
},
27+
nav: [
28+
{ text: '数据库综合', link: '/01.数据库综合/' },
29+
{ text: '数据库中间件', link: '/02.数据库中间件/' },
30+
{
31+
text: '关系型数据库',
32+
link: '/03.关系型数据库/',
33+
items: [
34+
{ text: '综合', link: '/03.关系型数据库/01.综合/' },
35+
{ text: 'Mysql', link: '/03.关系型数据库/02.Mysql/' },
36+
{ text: '其他', link: '/03.关系型数据库/99.其他/' },
37+
],
38+
},
39+
{
40+
text: '文档数据库',
41+
items: [{ text: 'MongoDB', link: '/04.文档数据库/01.MongoDB/' }],
42+
},
43+
{
44+
text: 'KV数据库',
45+
items: [{ text: 'Redis', link: '/05.KV数据库/01.Redis/' }],
46+
},
47+
{
48+
text: '搜索引擎数据库',
49+
items: [
50+
{ text: 'Elasticsearch', link: '/07.搜索引擎数据库/01.Elasticsearch/' },
51+
{ text: 'Elastic技术栈', link: '/07.搜索引擎数据库/02.Elastic/' },
6252
],
63-
sidebar: 'auto',
64-
sidebarDepth: 2,
6553
},
54+
],
55+
sidebarDepth: 2, // 侧边栏显示深度,默认1,最大2(显示到h3标题)
56+
logo: 'https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo-200.png', // 导航栏logo
57+
repo: 'dunwu/db-tutorial', // 导航栏右侧生成Github链接
58+
searchMaxSuggestions: 10, // 搜索结果显示最大数
59+
lastUpdated: '上次更新', // 更新的时间,及前缀文字 string | boolean (取值为git提交时间)
60+
61+
docsDir: 'docs', // 编辑的文件夹
62+
editLinks: true, // 编辑链接
63+
editLinkText: '📝 帮助改善此页面!',
64+
65+
// 以下配置是Vdoing主题改动的和新增的配置
66+
sidebar: { mode: 'structuring', collapsable: false }, // 侧边栏 'structuring' | { mode: 'structuring', collapsable: Boolean} | 'auto' | 自定义 温馨提示:目录页数据依赖于结构化的侧边栏数据,如果你不设置为'structuring',将无法使用目录页
67+
68+
// sidebarOpen: false, // 初始状态是否打开侧边栏,默认true
69+
updateBar: {
70+
// 最近更新栏
71+
showToArticle: true, // 显示到文章页底部,默认true
72+
// moreArticle: '/archives' // “更多文章”跳转的页面,默认'/archives'
6673
},
74+
// titleBadge: false, // 文章标题前的图标是否显示,默认true
75+
// titleBadgeIcons: [ // 文章标题前图标的地址,默认主题内置图标
76+
// '图标地址1',
77+
// '图标地址2'
78+
// ],
79+
// bodyBgImg: [
80+
// 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175828.jpeg',
81+
// 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175845.jpeg',
82+
// 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175846.jpeg'
83+
// ], // body背景大图,默认无。 单张图片 String || 多张图片 Array, 多张图片时每隔15秒换一张。
84+
85+
// categoryText: '随笔', // 碎片化文章(_posts文件夹的文章)预设生成的分类值,默认'随笔'
86+
87+
// contentBgStyle: 1,
88+
89+
category: false, // 是否打开分类功能,默认true。 如打开,会做的事情有:1. 自动生成的frontmatter包含分类字段 2.页面中显示与分类相关的信息和模块 3.自动生成分类页面(在@pages文件夹)。如关闭,则反之。
90+
tag: false, // 是否打开标签功能,默认true。 如打开,会做的事情有:1. 自动生成的frontmatter包含标签字段 2.页面中显示与标签相关的信息和模块 3.自动生成标签页面(在@pages文件夹)。如关闭,则反之。
91+
archive: true, // 是否打开归档功能,默认true。 如打开,会做的事情有:1.自动生成归档页面(在@pages文件夹)。如关闭,则反之。
92+
93+
author: {
94+
// 文章默认的作者信息,可在md文件中单独配置此信息 String | {name: String, href: String}
95+
name: 'dunwu', // 必需
96+
href: 'https://github.com/dunwu', // 可选的
97+
},
98+
social: {
99+
// 社交图标,显示于博主信息栏和页脚栏
100+
// iconfontCssFile: '//at.alicdn.com/t/font_1678482_u4nrnp8xp6g.css', // 可选,阿里图标库在线css文件地址,对于主题没有的图标可自由添加
101+
icons: [
102+
{
103+
iconClass: 'icon-youjian',
104+
title: '发邮件',
105+
link: 'mailto:forbreak@163.com',
106+
},
107+
{
108+
iconClass: 'icon-github',
109+
title: 'GitHub',
110+
link: 'https://github.com/dunwu',
111+
},
112+
],
113+
},
114+
footer: {
115+
// 页脚信息
116+
createYear: 2019, // 博客创建年份
117+
copyrightInfo: '钝悟(dunwu) | CC-BY-SA-4.0', // 博客版权信息,支持a标签
118+
},
119+
htmlModules,
67120
},
121+
122+
// 插件
68123
plugins: [
69124
[
70-
'@vuepress/active-header-links',
125+
require('./plugins/love-me'),
71126
{
72-
sidebarLinkSelector: '.sidebar-link',
73-
headerAnchorSelector: '.header-anchor',
127+
// 鼠标点击爱心特效
128+
color: '#11a8cd', // 爱心颜色,默认随机色
129+
excludeClassName: 'theme-vdoing-content', // 要排除元素的class, 默认空''
74130
},
75131
],
76-
['@vuepress/back-to-top', true],
132+
133+
['fulltext-search'], // 全文搜索
134+
135+
// ['thirdparty-search', { // 可以添加第三方搜索链接的搜索框(原官方搜索框的参数仍可用)
136+
// thirdparty: [ // 可选,默认 []
137+
// {
138+
// title: '在GitHub中搜索',
139+
// frontUrl: 'https://github.com/search?q=', // 搜索链接的前面部分
140+
// behindUrl: '' // 搜索链接的后面部分,可选,默认 ''
141+
// },
142+
// {
143+
// title: '在npm中搜索',
144+
// frontUrl: 'https://www.npmjs.com/search?q=',
145+
// },
146+
// {
147+
// title: '在Bing中搜索',
148+
// frontUrl: 'https://cn.bing.com/search?q='
149+
// }
150+
// ]
151+
// }],
152+
77153
[
78-
'@vuepress/pwa',
154+
'one-click-copy',
79155
{
80-
serviceWorker: true,
81-
updatePopup: true,
156+
// 代码块复制按钮
157+
copySelector: ['div[class*="language-"] pre', 'div[class*="aside-code"] aside'], // String or Array
158+
copyMessage: '复制成功', // default is 'Copy successfully and then paste it for use.'
159+
duration: 1000, // prompt message display time.
160+
showInMobile: false, // whether to display on the mobile side, default: false.
82161
},
83162
],
84163
[
85-
'@vuepress/last-updated',
164+
'demo-block',
86165
{
87-
transformer: (timestamp, lang) => {
88-
// 不要忘了安装 moment
89-
const moment = require('moment')
90-
moment.locale(lang)
91-
return moment(timestamp).fromNow()
166+
// demo演示模块 https://github.com/xiguaxigua/vuepress-plugin-demo-block
167+
settings: {
168+
// jsLib: ['http://xxx'], // 在线示例(jsfiddle, codepen)中的js依赖
169+
// cssLib: ['http://xxx'], // 在线示例中的css依赖
170+
// vue: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js', // 在线示例中的vue依赖
171+
jsfiddle: false, // 是否显示 jsfiddle 链接
172+
codepen: true, // 是否显示 codepen 链接
173+
horizontal: false, // 是否展示为横向样式
92174
},
93175
},
94176
],
95-
['@vuepress/medium-zoom', true],
96177
[
97-
'container',
178+
'vuepress-plugin-zooming', // 放大图片
98179
{
99-
type: 'vue',
100-
before: '<pre class="vue-container"><code>',
101-
after: '</code></pre>',
180+
selector: '.theme-vdoing-content img:not(.no-zoom)',
181+
options: {
182+
bgColor: 'rgba(0,0,0,0.6)',
183+
},
102184
},
103185
],
104186
[
105-
'container',
187+
'@vuepress/last-updated', // "上次更新"时间格式
106188
{
107-
type: 'upgrade',
108-
before: (info) => `<UpgradePath title="${info}">`,
109-
after: '</UpgradePath>',
189+
transformer: (timestamp, lang) => {
190+
const dayjs = require('dayjs') // https://day.js.org/
191+
return dayjs(timestamp).format('YYYY/MM/DD, HH:mm:ss')
192+
},
110193
},
111194
],
112-
['flowchart'],
113195
],
196+
197+
// 监听文件变化并重新构建
198+
extraWatchFiles: ['.vuepress/config.js', '.vuepress/config/htmlModules.js'],
114199
}

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 = '';

docs/.vuepress/config/htmlModules.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/** 插入自定义html模块 (可用于插入广告模块等)
2+
* {
3+
* homeSidebarB: htmlString, 首页侧边栏底部
4+
*
5+
* sidebarT: htmlString, 全局左侧边栏顶部
6+
* sidebarB: htmlString, 全局左侧边栏底部
7+
*
8+
* pageT: htmlString, 全局页面顶部
9+
* pageB: htmlString, 全局页面底部
10+
* pageTshowMode: string, 页面顶部-显示方式:未配置默认全局;'article' => 仅文章页①; 'custom' => 仅自定义页①
11+
* pageBshowMode: string, 页面底部-显示方式:未配置默认全局;'article' => 仅文章页①; 'custom' => 仅自定义页①
12+
*
13+
* windowLB: htmlString, 全局左下角②
14+
* windowRB: htmlString, 全局右下角②
15+
* }
16+
*
17+
* ①注:在.md文件front matter配置`article: false`的页面是自定义页,未配置的默认是文章页(首页除外)。
18+
* ②注:windowLB 和 windowRB:1.展示区块最大宽高200px*400px。2.请给自定义元素定一个不超过200px*400px的宽高。3.在屏幕宽度小于960px时无论如何都不会显示。
19+
*/
20+
21+
module.exports = {
22+
// 万维广告
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+
`,
30+
windowRB: `
31+
<div class="wwads-cn wwads-vertical windowRB" data-id="136" style="max-width:160px;
32+
min-width: auto;min-height:auto;"></div>
33+
<style>
34+
.windowRB{ padding: 0;}
35+
.windowRB .wwads-img{margin-top: 10px;}
36+
.windowRB .wwads-content{margin: 0 10px 10px 10px;}
37+
.custom-html-window-rb .close-but{
38+
display: none;
39+
}
40+
</style>
41+
`,
42+
}
43+
44+
// module.exports = {
45+
// homeSidebarB: `<div style="width:100%;height:100px;color:#fff;background: #eee;">自定义模块测试</div>`,
46+
// sidebarT: `<div style="width:100%;height:100px;color:#fff;background: #eee;">自定义模块测试</div>`,
47+
// sidebarB: `<div style="width:100%;height:100px;color:#fff;background: #eee;">自定义模块测试</div>`,
48+
// pageT: `<div style="width:100%;height:100px;color:#fff;background: #eee;">自定义模块测试</div>`,
49+
// pageB: `<div style="width:100%;height:100px;color:#fff;background: #eee;">自定义模块测试</div>`,
50+
// windowLB: `<div style="width:100%;height:100px;color:#fff;background: #eee;">自定义模块测试</div>`,
51+
// windowRB: `<div style="width:100%;height:100px;color:#fff;background: #eee;">自定义模块测试</div>`,
52+
// }

docs/.vuepress/enhanceApp.js

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,55 @@
1-
export default ({ Vue, isServer }) => {
1+
/**
2+
* to主题使用者:你可以去掉本文件的所有代码
3+
*/
4+
export default ({
5+
Vue, // VuePress 正在使用的 Vue 构造函数
6+
options, // 附加到根实例的一些选项
7+
router, // 当前应用的路由实例
8+
siteData, // 站点元数据
9+
isServer, // 当前应用配置是处于 服务端渲染 还是 客户端
10+
}) => {
11+
// 用于监控在路由变化时检查广告拦截器 (to主题使用者:你可以去掉本文件的所有代码)
212
if (!isServer) {
3-
import('vue-toasted' /* webpackChunkName: "notification" */).then(module => {
4-
Vue.use(module.default)
13+
router.afterEach(() => {
14+
//check if wwads' fire function was blocked after document is ready with 3s timeout (waiting the ad loading)
15+
docReady(function () {
16+
// setTimeout(function () {
17+
// if (window._AdBlockInit === undefined) {
18+
// ABDetected()
19+
// }
20+
// }, 3000)
21+
})
22+
23+
// 删除事件改为隐藏事件
24+
setTimeout(() => {
25+
const pageB = document.querySelector('.pageB')
26+
if (!pageB) return
27+
const btnEl = pageB.querySelector('.wwads-hide')
28+
if (btnEl) {
29+
btnEl.onclick = () => {
30+
pageB.style.display = 'none'
31+
}
32+
}
33+
// 显示广告模块
34+
pageB.style.display = 'flex'
35+
}, 0)
536
})
637
}
738
}
39+
40+
function ABDetected() {
41+
const h =
42+
"<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>"
43+
const wwadsEl = document.getElementsByClassName('wwads-cn')
44+
const wwadsContentEl = document.querySelector('.wwads-content')
45+
if (wwadsEl[0] && !wwadsContentEl) {
46+
wwadsEl[0].innerHTML = h
47+
}
48+
}
49+
50+
//check document ready
51+
function docReady(t) {
52+
'complete' === document.readyState || 'interactive' === document.readyState
53+
? setTimeout(t, 1)
54+
: document.addEventListener('DOMContentLoaded', t)
55+
}

0 commit comments

Comments
 (0)