diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.ts similarity index 66% rename from docs/.vuepress/config.js rename to docs/.vuepress/config.ts index 2faabfa..a88ba6d 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.ts @@ -1,9 +1,17 @@ -const baiduCode = require('./config/baiduCode.js'); // 百度统计hm码 -const htmlModules = require('./config/htmlModules.js'); +import { resolve } from 'path' +import { defineConfig4CustomTheme } from 'vuepress/config' +import { VdoingThemeConfig } from '../../theme-vdoing/types' +// import { VdoingThemeConfig } from 'vuepress-theme-vdoing/types' +import dayjs from 'dayjs' +import baiduCode from './config/baiduCode' // 百度统计hm码 +import htmlModules from './config/htmlModules' // 自定义插入的html块 -module.exports = { - theme: 'vdoing', // 使用npm包主题 - // theme: require.resolve('../../theme-vdoing'), // 使用本地主题 + + + +export default defineConfig4CustomTheme({ + // theme: 'vdoing', // 使用npm包主题 + theme: resolve(__dirname, '../../theme-vdoing'), // 使用本地主题 title: "Evan's blog", description: 'web前端技术博客,专注web前端学习与总结。JavaScript,js,ES6,TypeScript,vue,React,python,css3,html5,Node,git,github等技术文章。', @@ -123,8 +131,7 @@ module.exports = { // 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175845.jpeg', // 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175846.jpeg' // ], // body背景大图,默认无。 单张图片 String | 多张图片 Array, 多张图片时每隔15秒换一张。 - // bodyBgImgOpacity: 0.5, // body背景图透明度,选值 0 ~ 1.0, 默认0.5 - + // bodyBgImgOpacity: 0.5, // body背景图透明度,选值 0.1~ 1.0, 默认0.5 // titleBadge: false, // 文章标题前的图标是否显示,默认true // titleBadgeIcons: [ // 文章标题前图标的地址,默认主题内置图标 // '图标地址1', @@ -141,6 +148,7 @@ module.exports = { // pageButton: false, // 是否显示快捷翻页按钮,默认true // 侧边栏 'structuring' | { mode: 'structuring', collapsable: Boolean} | 'auto' | <自定义> 温馨提示:目录页数据依赖于结构化的侧边栏数据,如果你不设置为'structuring',将无法使用目录页 + // @ts-ignore sidebar: 'structuring', // 文章默认的作者信息,可在md文件中单独配置此信息 String | {name: String, link: String} @@ -201,123 +209,111 @@ module.exports = { ], ['meta', { name: 'baidu-site-verification', content: '7F55weZDDc' }], // 百度统计的站长验证(你可以去掉) ['meta', { name: 'theme-color', content: '#11a8cd' }], // 移动浏览器主题颜色 - [ - 'script', - { - 'data-ad-client': 'ca-pub-7828333725993554', - async: 'async', - src: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', - }, - ], // 网站关联Google AdSense 与 html格式广告支持(你可以去掉) + // [ + // 'script', + // { + // 'data-ad-client': 'ca-pub-7828333725993554', + // async: 'async', + // src: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', + // }, + // ], // 网站关联Google AdSense 与 html格式广告支持(你可以去掉) ], // 插件配置 - plugins: [ - // 本地插件(供学习) - // [require('./plugins/love-me'), { // 鼠标点击爱心特效 + plugins: { + // 导入本地插件(供学习参考) + // [resolve(__dirname, './plugins/love-me')]: { // 鼠标点击爱心特效 // color: '#11a8cd', // 爱心颜色,默认随机色 // excludeClassName: 'theme-vdoing-content' // 要排除元素的class, 默认空'' - // }], + // }, - 'vuepress-plugin-baidu-autopush', // 百度自动推送 + // 百度自动推送 + 'vuepress-plugin-baidu-autopush': {}, - // 可以添加第三方搜索链接的搜索框(原官方搜索框的参数仍可用) - [ - 'thirdparty-search', - { - thirdparty: [ - // 可选,默认 [] - { - title: '在MDN中搜索', - frontUrl: 'https://developer.mozilla.org/zh-CN/search?q=', // 搜索链接的前面部分 - behindUrl: '', // 搜索链接的后面部分,可选,默认 '' - }, - { - title: '在Runoob中搜索', - frontUrl: 'https://www.runoob.com/?s=', - }, - { - title: '在Vue API中搜索', - frontUrl: 'https://cn.vuejs.org/v2/api/#', - }, - { - title: '在Bing中搜索', - frontUrl: 'https://cn.bing.com/search?q=', - }, - { - title: '通过百度搜索本站的', - frontUrl: 'https://www.baidu.com/s?wd=site%3Axugaoyi.com%20', - }, - ], - }, - ], + // 百度统计 + 'vuepress-plugin-baidu-tongji': { + hm: baiduCode, + }, - [ - 'one-click-copy', // 代码块复制按钮 - { - copySelector: ['div[class*="language-"] pre', 'div[class*="aside-code"] aside'], // String or Array - copyMessage: '复制成功', // default is 'Copy successfully and then paste it for use.' - duration: 1000, // prompt message display time. - showInMobile: false, // whether to display on the mobile side, default: false. - }, - ], + // 可以添加第三方搜索链接的搜索框(继承原官方搜索框的配置参数) + 'thirdparty-search': { + thirdparty: [ + { + title: '在MDN中搜索', + frontUrl: 'https://developer.mozilla.org/zh-CN/search?q=', // 搜索链接的前面部分 + behindUrl: '', // 搜索链接的后面部分,可选,默认 '' + }, + { + title: '在Runoob中搜索', + frontUrl: 'https://www.runoob.com/?s=', + }, + { + title: '在Vue API中搜索', + frontUrl: 'https://cn.vuejs.org/v2/api/#', + }, + { + title: '在Bing中搜索', + frontUrl: 'https://cn.bing.com/search?q=', + }, + { + title: '通过百度搜索本站的', + frontUrl: 'https://www.baidu.com/s?wd=site%3Axugaoyi.com%20', + }, + ], + }, - [ - 'demo-block', // demo演示模块 https://github.com/xiguaxigua/vuepress-plugin-demo-block - { - settings: { - // jsLib: ['http://xxx'], // 在线示例(jsfiddle, codepen)中的js依赖 - // cssLib: ['http://xxx'], // 在线示例中的css依赖 - // vue: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js', // 在线示例中的vue依赖 - jsfiddle: false, // 是否显示 jsfiddle 链接 - codepen: true, // 是否显示 codepen 链接 - horizontal: false, // 是否展示为横向样式 - }, + // 代码块复制按钮 + 'one-click-copy': { + copySelector: ['div[class*="language-"] pre', 'div[class*="aside-code"] aside'], // String or Array + copyMessage: '复制成功', // default is 'Copy successfully and then paste it for use.' + duration: 1000, // prompt message display time. + showInMobile: false, // whether to display on the mobile side, default: false. + }, + + // DEMO演示模块, API: https://github.com/xiguaxigua/vuepress-plugin-demo-block + 'demo-block': { + settings: { + // jsLib: ['http://xxx'], // 在线示例(jsfiddle, codepen)中的js依赖 + // cssLib: ['http://xxx'], // 在线示例中的css依赖 + // vue: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js', // 在线示例中的vue依赖 + jsfiddle: false, // 是否显示 jsfiddle 链接 + codepen: true, // 是否显示 codepen 链接 + horizontal: false, // 是否展示为横向样式 }, - ], - [ - 'vuepress-plugin-zooming', // 放大图片 - { - selector: '.theme-vdoing-content img:not(.no-zoom)', // 排除class是no-zoom的图片 - options: { - bgColor: 'rgba(0,0,0,0.6)', - }, + }, + + // 放大图片 + 'vuepress-plugin-zooming': { + selector: '.theme-vdoing-content img:not(.no-zoom)', // not排除class是no-zoom的图片 + options: { + bgColor: 'rgba(0,0,0,0.6)', }, - ], - [ - 'vuepress-plugin-baidu-tongji', // 百度统计 (你可以去掉) - { - hm: baiduCode || '503f098e7e5b3a5b5d8c5fc2938af002', + }, + + // 评论区 + 'vuepress-plugin-comment': { + choosen: 'gitalk', + options: { + clientID: 'a6e1355287947096b88b', + clientSecret: 'f0e77d070fabfcd5af95bebb82b2d574d7248d71', + repo: 'blog-gitalk-comment', // GitHub 仓库 + owner: 'xugaoyi', // GitHub仓库所有者 + admin: ['xugaoyi'], // 对仓库有写权限的人 + // distractionFreeMode: true, + pagerDirection: 'last', // 'first'正序 | 'last'倒序 + id: '<%- (frontmatter.permalink || frontmatter.to.path).slice(-16) %>', // 页面的唯一标识,长度不能超过50 + title: '「评论」<%- frontmatter.title %>', // GitHub issue 的标题 + labels: ['Gitalk', 'Comment'], // GitHub issue 的标签 + body: + '页面:<%- window.location.origin + (frontmatter.to.path || window.location.pathname) %>', // GitHub issue 的内容 }, - ], - [ - 'vuepress-plugin-comment', // 评论 - { - choosen: 'gitalk', - options: { - clientID: 'a6e1355287947096b88b', - clientSecret: 'f0e77d070fabfcd5af95bebb82b2d574d7248d71', - repo: 'blog-gitalk-comment', // GitHub 仓库 - owner: 'xugaoyi', // GitHub仓库所有者 - admin: ['xugaoyi'], // 对仓库有写权限的人 - // distractionFreeMode: true, - pagerDirection: 'last', // 'first'正序 | 'last'倒序 - id: '<%- (frontmatter.permalink || frontmatter.to.path).slice(-16) %>', // 页面的唯一标识,长度不能超过50 - title: '「评论」<%- frontmatter.title %>', // GitHub issue 的标题 - labels: ['Gitalk', 'Comment'], // GitHub issue 的标签 - body: - '页面:<%- window.location.origin + (frontmatter.to.path || window.location.pathname) %>', // GitHub issue 的内容 - }, + }, + + // "上次更新"的时间格式 + '@vuepress/last-updated': { + transformer: (timestamp, lang) => { + return dayjs(timestamp).format('YYYY/MM/DD, HH:mm:ss') }, - ], - [ - '@vuepress/last-updated', // "上次更新"时间格式 - { - transformer: (timestamp, lang) => { - const dayjs = require('dayjs') // https://day.js.org/ - return dayjs(timestamp).format('YYYY/MM/DD, HH:mm:ss') - }, - }, - ], - ], -} + }, + }, +}) diff --git a/docs/.vuepress/config/baiduCode.js b/docs/.vuepress/config/baiduCode.js index 9dc5fc1..8765ff6 100644 --- a/docs/.vuepress/config/baiduCode.js +++ b/docs/.vuepress/config/baiduCode.js @@ -1 +1 @@ -module.exports = ''; +export default '503f098e7e5b3a5b5d8c5fc2938af002' diff --git a/docs/.vuepress/config/htmlModules.js b/docs/.vuepress/config/htmlModules.js index 450d4e2..324fd67 100644 --- a/docs/.vuepress/config/htmlModules.js +++ b/docs/.vuepress/config/htmlModules.js @@ -18,7 +18,7 @@ * ②注:windowLB 和 windowRB:1.展示区块最大宽高200px*400px。2.请给自定义元素定一个不超过200px*400px的宽高。3.在屏幕宽度小于960px时无论如何都不会显示。 */ -module.exports = { +const htmlModule = { homeSidebarB: `

自定义模块测试

`, // sidebarT: `
自定义模块测试
`, // sidebarB: `
自定义模块测试
`, @@ -119,3 +119,6 @@ module.exports = { // windowLB: `
自定义模块测试
`, // windowRB: `
自定义模块测试
`, // } + + +export default htmlModule diff --git a/docs/03.技术/01.技术文档/02.Markdown使用教程.md b/docs/03.技术/01.技术文档/02.Markdown使用教程.md index 07d2245..049977d 100644 --- a/docs/03.技术/01.技术文档/02.Markdown使用教程.md +++ b/docs/03.技术/01.技术文档/02.Markdown使用教程.md @@ -2,12 +2,12 @@ title: Markdown使用教程 date: 2019-12-25 14:27:01 permalink: /pages/ad247c4332211551 -categories: +categories: - 技术 - 技术文档 -tags: +tags: - null -author: +author: name: xugaoyi link: https://github.com/xugaoyi --- @@ -192,7 +192,7 @@ Markdown 段落没有特殊的格式,直接编写文字,**需要段落缩进 ### 字体 ```markdown -*斜体文本* +*斜体文本* 或 _斜体文本_ **粗体文本** 或 __粗体文本__ @@ -245,10 +245,10 @@ ___粗斜体文本___ 文字高亮能使行内部分文字高亮,使用一对反引号。 ```markdown -`html` `css` `javascript` +`html` `css` `javascript` ``` -`html` `css` `javascript` +`html` `css` `javascript` @@ -435,7 +435,7 @@ ___粗斜体文本___ - [ ] 第三项 - + ### 列表嵌套 @@ -537,7 +537,7 @@ ___粗斜体文本___ 如果是段落上的一个代码片段可以用反引号把它包起来(**`**),示例: ```markdown -`alert()` +`alert()` ``` `alert()` @@ -648,7 +648,7 @@ function test() { [Markdown](#一Markdown) -[链接](#九链接) +[链接](#九链接) [流程图](#流程图) @@ -665,7 +665,7 @@ function test() { 当然,你也可以像链接那样对图片地址使用变量: ```markdown -这里链接用 img 作为图片地址变量 +这里链接用 img 作为图片地址变量 然后在文档的结尾或其他位置给变量赋值(图片地址) ![RUNOOB][img] [img]: https://raw.githubusercontent.com/xugaoyi/image_store/master/blog/md_logo.png @@ -740,7 +740,7 @@ github上如果引用其他github仓库中的图片则要注意地址格式:` **对齐方式** -- **-:** 设置内容和标题栏居右对齐 +- **-:** 设置内容和标题栏居右对齐 - **:-** 设置内容和标题栏居左对齐 - **:-:** 设置内容和标题栏居中对齐 @@ -798,11 +798,11 @@ Emoji表情英文名的前后加冒号,Typore上先输入冒号再输入首字 Markdown 使用了很多特殊符号来表示特定的意义,如果需要显示特定的符号则需要使用反斜杠转义字符: ```markdown -**未转义星号显示加粗** +**未转义星号显示加粗** \*\* 转义显示星号 \*\* ``` -**未转义星号显示加粗** +**未转义星号显示加粗** \*\* 转义显示星号 \*\* @@ -840,7 +840,7 @@ _ 下划线 ```markdown $$ -\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} +\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \\ @@ -851,7 +851,7 @@ $$ $$ -\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} +\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \\ @@ -860,7 +860,7 @@ $$ ### 图表 -```markdown +````markdown ​```chart ,Budget,Income,Expenses,Debt June,5000,8000,4000,6000 @@ -881,31 +881,14 @@ sequenceDiagram A->>B: 是否已收到消息? B-->>A: 已收到消息 ​``` -``` +```` > 注:在Typora中未支持 -```chart -,Budget,Income,Expenses,Debt -June,5000,8000,4000,6000 -July,3000,1000,4000,3000 -Aug,5000,7000,6000,3000 -Sep,7000,2000,3000,1000 -Oct,6000,5000,4000,2000 -Nov,4000,3000,5000, - -type: pie -title: Monthly Revenue -x.title: Amount -y.title: Month -y.suffix: $ -``` - - ### 流程图 -```markdown +````markdown 语法: ​```mermaid graph TD @@ -915,7 +898,7 @@ C -->|条件C1| D[模块D] C -->|条件C2| E[模块E] C -->|条件C3| F[模块F] ​``` -``` +```` 流程图相关文章: @@ -923,40 +906,26 @@ C -->|条件C3| F[模块F] -```mermaid -graph TD -A[模块A] -->|A1| B(模块B) -B --> C{判断条件C} -C -->|条件C1| D[模块D] -C -->|条件C2| E[模块E] -C -->|条件C3| F[模块F] -``` + ### 时序图 -```markdown +````markdown ​```mermaid sequenceDiagram A->>B: 是否已收到消息? B-->>A: 已收到消息 ​``` -``` +```` -```mermaid -sequenceDiagram -A->>B: 是否已收到消息? -B-->>A: 已收到消息 -``` + ### 甘特图 - -### 甘特图 - -``` markdown +```` markdown ​```mermaid gantt title 甘特图 @@ -968,18 +937,6 @@ section 项目B 任务3 :2018-06-12 , 12d 任务4 : 24d ​``` -``` +```` -```mermaid -gantt -title 甘特图 -dateFormat YYYY-MM-DD -section 项目A -任务1 :a1, 2018-06-06, 30d -任务2 :after a1 , 20d -section 项目B -任务3 :2018-06-12 , 12d -任务4 : 24d -``` - -​ [回到顶部](#markdown使用教程) \ No newline at end of file +​ [回到顶部](#markdown使用教程) diff --git a/docs/04.更多/10.实用技巧/10.一行代码“黑”掉任意网站.md b/docs/04.更多/10.实用技巧/10.一行代码“黑”掉任意网站.md index 4064940..baefe45 100644 --- a/docs/04.更多/10.实用技巧/10.一行代码“黑”掉任意网站.md +++ b/docs/04.更多/10.实用技巧/10.一行代码“黑”掉任意网站.md @@ -2,6 +2,7 @@ title: 一行代码“黑”掉任意网站 date: 2021-11-25 14:33:51 permalink: /pages/dcebaf/ +titleTag: 原创 sticky: 1 categories: - 更多 diff --git a/docs/《Vue》笔记/02.组件/90.vue父子组件的生命周期顺序.md b/docs/《Vue》笔记/02.组件/90.vue父子组件的生命周期顺序.md index dd10735..17d7a47 100644 --- a/docs/《Vue》笔记/02.组件/90.vue父子组件的生命周期顺序.md +++ b/docs/《Vue》笔记/02.组件/90.vue父子组件的生命周期顺序.md @@ -15,7 +15,7 @@ author: ### 加载渲染过程 -```repl +```text 父beforeCreate -> 父created-> 父beforeMount-> 子beforeCreate -> 子created -> 子beforeMount -> 子mounted -> 父mounted ``` @@ -23,18 +23,18 @@ author: ### 子组件更新过程 -```repl +```text 父beforeUpdate -> 子beforeUpdate -> 子updated -> 父updated ``` ### 父组件更新过程 -```repl +```text 父beforeUpdate -> 父updated ``` ### 销毁过程 -```repl +```text 父beforeDestroy -> 子beforeDestroy -> 子destroyed -> 父destroyed ``` diff --git a/package.json b/package.json index 871aa70..21c0d6e 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "dayjs": "^1.9.7", "inquirer": "^7.1.0", "json2yaml": "^1.1.0", - "vuepress": "1.8.0", + "vuepress": "1.9.2", "vuepress-plugin-baidu-autopush": "^1.0.1", "vuepress-plugin-baidu-tongji": "^1.0.1", "vuepress-plugin-demo-block": "^0.7.2", diff --git a/theme-vdoing/components/ArchivesPage.vue b/theme-vdoing/components/ArchivesPage.vue index e464758..4dbd565 100644 --- a/theme-vdoing/components/ArchivesPage.vue +++ b/theme-vdoing/components/ArchivesPage.vue @@ -6,8 +6,11 @@ :src="currentBadge" v-if="$themeConfig.titleBadge === false ? false : true" /> - {{ this.$page.title }} + {{ $page.title }} +
+ 总共 {{ $sortPostsByDate.length }} 篇文章 +