diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d1e9044 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: CI + +#on: [push] + +# 在master分支发生push事件时触发。 +on: + push: + branches: + - master + +jobs: # 工作流 + build: # 自定义名称 + runs-on: ubuntu-latest #运行在虚拟机环境ubuntu-latest + + strategy: + matrix: + node-version: [14.x] + + steps: # 步骤 + # 步骤1 + - name: Checkout + # 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions + uses: actions/checkout@v1 + + - name: Use Node.js ${{ matrix.node-version }} # 步骤2 + uses: actions/setup-node@v1 # 作用:安装nodejs + with: + node-version: ${{ matrix.node-version }} # 版本 + # 步骤2:执行脚本deploy.sh + - name: run deploy.sh + env: # 设置环境变量,未设置则不运行 + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} # toKen私密变量 + SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }} # gitee的ssh + + run: npm install && npm run deploy + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8704d96 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# npm +package-lock.json +node_modules + +# vscode +.vscode + +# vuepress +docs/.vuepress/dist + +# 百度链接推送 +urls.txt +### mac ### +.DS_Store +**/.DS_Store +.DS_Store? +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..db36825 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +使用 [vuepress](https://vuepress.vuejs.org/zh) 搭建,自动部署在[GitHub Pages](https://pages.github.com/) + + + +> 在线浏览地址: + +- 国外: +- 国内: + +笔记内容若有任何问题,请各位大佬斧正! + +觉得有用的话,麻烦各位大佬帮忙点个 star ,满足一下我的虚荣心。 + + + +> 学习路线 + +尚硅谷的java学习路线: + +狂神的java视频地址: + + + +> 项目部署 + +查看此处: + diff --git a/base.js b/base.js new file mode 100644 index 0000000..430c4a3 --- /dev/null +++ b/base.js @@ -0,0 +1 @@ +module.exports = '/' \ No newline at end of file diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..4979cfe --- /dev/null +++ b/deploy.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env sh + +# 确保脚本抛出遇到的错误 +set -e + +initDist(){ + echo $1 > base.js +} + + + +#------------------------------------------ + +#url访问目录,这个是你 github 仓库的名字 +initDist "module.exports = '/notes/'" + +# 生成静态文件 +npm run build +# 进入生成的文件夹 +cd docs/.vuepress/dist + +# deploy to github +if [ -z "$GITHUB_TOKEN" ]; then + # 手动部署 + msg='deploy' + githubUrl=git@github.com:oddfar/notes.git +else + # 自动部署 + msg='来自github actions的自动部署' + githubUrl=https://oddfar:${GITHUB_TOKEN}@github.com/oddfar/notes.git + git config --global user.name "oddfar" + git config --global user.email "oddfar@163.com" +fi +git init +git add -A +git commit -m "${msg}" +git push -f $githubUrl master:gh-pages # 推送到github + + +cd - # 退回开始所在目录 +rm -rf docs/.vuepress/dist + +#------------------------------------------ + + +#打包代码同步到 gitee gh-pages分支 +if [ -z "$SSH_PRIVATE_KEY" ]; then + echo '如果是空字符串,则不部署到gitee' +else + #url访问目录 + initDist "module.exports = '/'" + # 生成静态文件 + npm run build + # 进入生成的文件夹 + cd docs/.vuepress/dist + + giteeUrl=git@gitee.com:oddfar/notes.git #gitee 仓库ssh地址 + + git config --global user.name "oddfar" + git config --global user.email "oddfar@163.com" + git init + git add -A + git commit -m "来自github actions的自动部署" + git push -f $giteeUrl master:gh-pages + + cd - # 退回开始所在目录 + rm -rf docs/.vuepress/dist + # 删除秘钥 + rm -rf ~/.ssh +fi + + diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js new file mode 100644 index 0000000..36856f3 --- /dev/null +++ b/docs/.vuepress/config.js @@ -0,0 +1,28 @@ +const plugins = require('./config/plugins.js'); +const base = require('../../base.js'); +const themeConfig = require('./config/themeConfig.js'); + + + +module.exports = { + theme: 'vdoing', // 使用npm包主题 + // theme: require.resolve('../../theme-vdoing'), // 使用本地主题 + port: 8080,//端口 + + plugins, + themeConfig, + base, //引入后缀 + + title: "Campus", + description: 'Campus 一款简单的后台管理系统,快速开发框架,适合大学生开发毕设,或其他小项目。', // 描述,以 标签渲染到页面html中 + + head: [ + ['link', { rel: 'icon', href: '/img/favicon.ico' }], + ['meta', { name: 'keywords', content: 'oddfar,zhiyuan,campus' }], + ['meta', { name: 'theme-color', content: '#11a8cd' }], // 移动浏览器主题颜色 + ], + markdown: { + lineNumbers: true, // 代码行号 + extractHeaders: [ 'h2', 'h3', 'h4', 'h5', 'h6' ] + }, +} \ No newline at end of file diff --git a/docs/.vuepress/config/plugins.js b/docs/.vuepress/config/plugins.js new file mode 100644 index 0000000..f4431a3 --- /dev/null +++ b/docs/.vuepress/config/plugins.js @@ -0,0 +1,75 @@ +//插件 +module.exports = [ + //本地插件 + [require('../plugins/love-me'), { // 鼠标点击爱心特效 + color: '#11a8cd', // 爱心颜色,默认随机色 + excludeClassName: 'theme-vdoing-content' // 要排除元素的class, 默认空'' + }], + + /* + + ['thirdparty-search', { // 可以添加第三方搜索链接的搜索框(原官方搜索框的参数仍可用) + thirdparty: [ // 可选,默认 [] + { + title: '在MDN中搜索', + frontUrl: 'https://developer.mozilla.org/zh-CN/search?q=', // 搜索链接的前面部分 + behindUrl: '' // 搜索链接的后面部分,可选,默认 '' + }, + { + title: '在Bing中搜索', + frontUrl: 'https://cn.bing.com/search?q=' + } + ] + }], + + */ + + //全文搜索插件 + ['fulltext-search'], + //sitemap 插件 + ['sitemap',{ + hostname: 'https://note.oddfar.com' + }], + + + + // 'vuepress-plugin-baidu-autopush', // 百度自动推送 + + ['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-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 // 是否展示为横向样式 + } + }], + [ + 'vuepress-plugin-zooming', // 放大图片 + { + selector: '.theme-vdoing-content img:not(.no-zoom)', // 排除class是no-zoom的图片 + options: { + bgColor: 'rgba(0,0,0,0.6)' + }, + }, + ], + + [ + '@vuepress/last-updated', // "上次更新"时间格式 + { + transformer: (timestamp, lang) => { + const moment = require('moment') // https://momentjs.com/ + return moment(timestamp).format('YYYY/MM/DD, H:MM:SS'); + } + } + ] + + +] \ No newline at end of file diff --git a/docs/.vuepress/config/sidebar.js b/docs/.vuepress/config/sidebar.js new file mode 100644 index 0000000..36bd5de --- /dev/null +++ b/docs/.vuepress/config/sidebar.js @@ -0,0 +1,104 @@ +// 此文件没有用到,仅用于测试和侧边栏数据格式的参考。 + +module.exports = { // 侧边栏 + '/01.前端/': [ + { + title: 'JavaScript', + collapsable: false, //是否可折叠,可选的,默认true + children: [ + ['01.JavaScript/01.JavaScript中的名词概念','JavaScript中的名词概念'], + ['01.JavaScript/02.数据类型转换','数据类型转换'], + ['01.JavaScript/03.ES5面向对象','ES5面向对象'], + ['01.JavaScript/04.ES6面向对象','ES6面向对象'], + ['01.JavaScript/05.new命令原理','new命令原理'], + ['01.JavaScript/06.多种数组去重性能对比','多种数组去重性能对比'], + ] + }, + ], + '/02.页面/': [ + { + title: 'html-css', + collapsable: false, + children: [ + ['01.html-css/00.flex布局语法','flex布局语法'], + ['01.html-css/01.flex布局案例-基础','flex布局案例-基础'], + ['01.html-css/02.flex布局案例-骰子','flex布局案例-骰子'], + ['01.html-css/03.flex布局案例-网格布局','flex布局案例-网格布局'], + ['01.html-css/04.flex布局案例-圣杯布局','flex布局案例-圣杯布局'], + ['01.html-css/05.flex布局案例-输入框布局','flex布局案例-输入框布局'], + ['01.html-css/06.CSS3之transform过渡','CSS3之transform过渡'], + ['01.html-css/07.CSS3之animation动画','CSS3之animation动画'], + ] + }, + ], + '/03.技术杂谈/': [ + { + title: '技术杂谈', + collapsable: false, //是否可折叠,可选的,默认true + sidebarDepth: 2, // 深度,可选的, 默认值是 1 + children: [ + ['01.Git使用手册','Git使用手册'], // 同 {path: '01.Git使用手册', title: 'Git使用文档'} + ['02.GitHub高级搜索技巧','GitHub高级搜索技巧'], + ['03.Markdown使用教程','Markdown使用教程'], + ['04.npm常用命令','npm常用命令'], + ['05.yaml语言教程','yaml语言教程'], + ['06.解决百度无法收录搭建在GitHub上的个人博客的问题','解决百度无法收录搭建在GitHub上的个人博客的问题'], + ['07.使用Gitalk实现静态博客无后台评论系统','使用Gitalk实现静态博客无后台评论系统'], + ] + } + ], + '/04.其他/': [ + { + title: '学习', + collapsable: false, + children: [ + ['01.学习/01.学习网站','学习网站'], + ['01.学习/02.学习效率低,忘性很大怎么办?','学习效率低,忘性很大怎么办?'], + ] + }, + { + title: '学习笔记', + collapsable: false, + children: [ + ['02.学习笔记/01.小程序笔记','小程序笔记'], + ] + }, + { + title: '面试', + collapsable: false, //是否可折叠,可选的,默认true + children: [ + ['03.面试/01.面试问题集锦','面试问题集锦'], + ] + }, + ['01.在线工具','在线工具'], + ['02.友情链接','友情链接'], + ], + // '/': [ // 在最后定义,在没有单独设置侧边栏时统一使用这个侧边栏 + // '', + // 'git', + // 'github', + // 'markdown', + // 'study', + // 'interview' + // // '/', + // // { + // // title: 'foo', // 标题,必要的 + // // path: '/foo/', // 标题的路径,可选的, 应该是一个绝对路径 + // // collapsable: false, // 是否可折叠,可选的,默认true + // // sidebarDepth: 1, // 深度,可选的, 默认值是 1 + // // children: [ + // // ['foo/', '子页1'], + // // 'foo/1', + // // 'foo/2', + // // ] + // // }, + // // { + // // title: 'bar', + // // children: [ + // // ['bar/', '子页2'], + // // 'bar/3', + // // 'bar/4', + // // ] + // // } + // ], +} \ No newline at end of file diff --git a/docs/.vuepress/config/themeConfig.js b/docs/.vuepress/config/themeConfig.js new file mode 100644 index 0000000..3891ff4 --- /dev/null +++ b/docs/.vuepress/config/themeConfig.js @@ -0,0 +1,72 @@ +const nav = require('./themeConfig/nav.js'); +const htmlModules = require('./themeConfig/htmlModules.js'); + +// 主题配置 +module.exports = { + nav,//导航栏 + sidebarDepth: 2, // 侧边栏显示深度,默认1,最大2(显示到h3标题) + logo: '/img/logo.png', // 导航栏logo + repo: 'oddfar/campus', // 导航栏右侧生成Github链接 + searchMaxSuggestions: 10, // 搜索结果显示最大数 + lastUpdated: '最后更新', // 更新的时间,及前缀文字 string | boolean (取值为git提交时间) + docsDir: 'docs', // 编辑的文件夹 + editLinks: false, // 启用编辑 + editLinkText: '在 GitHub 上编辑此页', + + // 以下配置是Vdoing主题改动的和新增的配置 + pageStyle: 'line', // 页面风格,可选值:'card'卡片 | 'line' 线(未设置bodyBgImg时才生效), 默认'card'。 说明:card时背景显示灰色衬托出卡片样式,line时背景显示纯色,并且部分模块带线条边框 + category: false, // 是否打开分类功能,默认true。 如打开,会做的事情有:1. 自动生成的frontmatter包含分类字段 2.页面中显示与分类相关的信息和模块 3.自动生成分类页面(在@pages文件夹)。如关闭,则反之。 + tag: false, // 是否打开标签功能,默认true。 如打开,会做的事情有:1. 自动生成的frontmatter包含标签字段 2.页面中显示与标签相关的信息和模块 3.自动生成标签页面(在@pages文件夹)。如关闭,则反之。 + // archive: false, // 是否打开归档功能,默认true。 如打开,会做的事情有:1.自动生成归档页面(在@pages文件夹)。如关闭,则反之。 + // categoryText: '随笔', // 碎片化文章(_posts文件夹的文章)预设生成的分类值,默认'随笔' + // bodyBgImg: [ + // 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175828.jpeg', + // '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秒换一张。 + // titleBadge: false, // 文章标题前的图标是否显示,默认true + // titleBadgeIcons: [ // 文章标题前图标的地址,默认主题内置图标 + // '图标地址1', + // '图标地址2' + // ], + + + sidebar: { mode: 'structuring', collapsable: true }, // 侧边栏 'structuring' | { mode: 'structuring', collapsable: Boolean} | 'auto' | 自定义 温馨提示:目录页数据依赖于结构化的侧边栏数据,如果你不设置为'structuring',将无法使用目录页 + + // sidebarOpen: false, // 初始状态是否打开侧边栏,默认true + updateBar: { // 最近更新栏 + showToArticle: false, // 显示到文章页底部,默认true + // moreArticle: '/archives' // “更多文章”跳转的页面,默认'/archives' + }, + + author: { // 文章默认的作者信息,可在md文件中单独配置此信息 String | {name: String, href: String} + name: 'zhiyuan', // 必需 + href: 'https://oddfar.com/' // 可选的 + }, + // blogger:{ // 博主信息,显示在首页侧边栏 + // avatar: 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg', + // name: '致远', + // slogan: '一个致障' + // }, + social:{ // 社交图标,显示于博主信息栏和页脚栏 + // iconfontCssFile: '//at.alicdn.com/t/font_1678482_u4nrnp8xp6g.css', // 可选,阿里图标库在线css文件地址,对于主题没有的图标可自由添加 + icons: [ + { + iconClass: 'icon-youjian', + title: '发邮件', + link: 'mailto:oddfar@163.com' + }, + { + iconClass: 'icon-github', + title: 'GitHub', + link: 'https://github.com/oddfar' + }, + ] + }, + footer: { // 页脚信息 + createYear: 2023, // 博客创建年份 + copyrightInfo: 'oddfar | MIT License', // 博客版权信息,支持a标签 + }, + //htmlModules // 插入hmtl(广告)模块 + +} \ No newline at end of file diff --git a/docs/.vuepress/config/themeConfig/htmlModules.js b/docs/.vuepress/config/themeConfig/htmlModules.js new file mode 100644 index 0000000..8518bb5 --- /dev/null +++ b/docs/.vuepress/config/themeConfig/htmlModules.js @@ -0,0 +1,105 @@ +/** 插入自定义html模块 (可用于插入广告模块等) + * { + * homeSidebarB: htmlString, 首页侧边栏底部 + * + * sidebarT: htmlString, 全局左侧边栏顶部 + * sidebarB: htmlString, 全局左侧边栏底部 + * + * pageT: htmlString, 全局页面顶部 + * pageB: htmlString, 全局页面底部 + * pageTshowMode: string, 页面顶部-显示方式:未配置默认全局;'article' => 仅文章页①; 'custom' => 仅自定义页① + * pageBshowMode: string, 页面底部-显示方式:未配置默认全局;'article' => 仅文章页①; 'custom' => 仅自定义页① + * + * windowLB: htmlString, 全局左下角② + * windowRB: htmlString, 全局右下角② + * } + * + * ①注:在.md文件front matter配置`article: false`的页面是自定义页,未配置的默认是文章页(首页除外)。 + * ②注:windowLB 和 windowRB:1.展示区块宽高最大是200*200px。2.请给自定义元素定一个不超过200px的固定宽高。3.在屏宽小于960px时无论如何都不会显示。 + */ + +module.exports = { + // homeSidebarB: + // ` + // + // `, + // sidebarT: + // ` + // + // `, + sidebarB: + ` + + `, + // pageT: // + // ` + // + // `, + // pageTshowMode: 'article', + pageB: + ` + + `, + // pageBshowMode: 'article', + // windowLB: // 遮挡部分侧边栏 + // ` + // + // `, + windowRB: + ` + + + `, +} + + +// module.exports = { +// homeSidebarB: `
自定义模块测试
`, +// sidebarT: `
自定义模块测试
`, +// sidebarB: `
自定义模块测试
`, +// pageT: `
自定义模块测试
`, +// pageB: `
自定义模块测试
`, +// windowLB: `
自定义模块测试
`, +// windowRB: `
自定义模块测试
`, +// } diff --git a/docs/.vuepress/config/themeConfig/nav.js b/docs/.vuepress/config/themeConfig/nav.js new file mode 100644 index 0000000..8530aac --- /dev/null +++ b/docs/.vuepress/config/themeConfig/nav.js @@ -0,0 +1,8 @@ +module.exports = [ + { text: '首页', link: '/' }, + { + text: '文档', link: '/campus/' + }, + { text: '案例', link: '/example/' }, + { text: 'Gitee', link: 'https://gitee.com/oddfar/campus' } +] \ No newline at end of file diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js new file mode 100644 index 0000000..1589fa4 --- /dev/null +++ b/docs/.vuepress/enhanceApp.js @@ -0,0 +1,9 @@ +// import vue from 'vue/dist/vue.esm.browser' +export default ({ + Vue, // VuePress 正在使用的 Vue 构造函数 + options, // 附加到根实例的一些选项 + router, // 当前应用的路由实例 + siteData // 站点元数据 +}) => { + // window.Vue = vue // 使页面中可以使用Vue构造函数 (使页面中的vue demo生效) +} diff --git a/docs/.vuepress/plugins/love-me/index.js b/docs/.vuepress/plugins/love-me/index.js new file mode 100644 index 0000000..674294c --- /dev/null +++ b/docs/.vuepress/plugins/love-me/index.js @@ -0,0 +1,12 @@ +const path= require('path'); +const LoveMyPlugin = (options={}) => ({ + define () { + const COLOR = options.color || "rgb(" + ~~ (255 * Math.random()) + "," + ~~ (255 * Math.random()) + "," + ~~ (255 * Math.random()) + ")" + const EXCLUDECLASS = options.excludeClassName || '' + return {COLOR, EXCLUDECLASS} + }, + enhanceAppFiles: [ + path.resolve(__dirname, 'love-me.js') + ] +}); +module.exports = LoveMyPlugin; diff --git a/docs/.vuepress/plugins/love-me/love-me.js b/docs/.vuepress/plugins/love-me/love-me.js new file mode 100644 index 0000000..f93855e --- /dev/null +++ b/docs/.vuepress/plugins/love-me/love-me.js @@ -0,0 +1,62 @@ +export default () => { + if (typeof window !== "undefined") { + (function(e, t, a) { + function r() { + for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999"); + requestAnimationFrame(r) + } + function n() { + var t = "function" == typeof e.onclick && e.onclick; + + e.onclick = function(e) { + // 过滤指定元素 + let mark = true; + EXCLUDECLASS && e.path && e.path.forEach((item) =>{ + if(item.nodeType === 1) { + typeof item.className === 'string' && item.className.indexOf(EXCLUDECLASS) > -1 ? mark = false : '' + } + }) + + if(mark) { + t && t(), + o(e) + } + } + } + function o(e) { + var a = t.createElement("div"); + a.className = "heart", + s.push({ + el: a, + x: e.clientX - 5, + y: e.clientY - 5, + scale: 1, + alpha: 1, + color: COLOR + }), + t.body.appendChild(a) + } + function i(e) { + var a = t.createElement("style"); + a.type = "text/css"; + try { + a.appendChild(t.createTextNode(e)) + } catch(t) { + a.styleSheet.cssText = e + } + t.getElementsByTagName("head")[0].appendChild(a) + } + // function c() { + // return "rgb(" + ~~ (255 * Math.random()) + "," + ~~ (255 * Math.random()) + "," + ~~ (255 * Math.random()) + ")" + // } + var s = []; + e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || + function(e) { + setTimeout(e, 1e3 / 60) + }, + i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"), + n(), + r() + })(window, document) + } +} \ No newline at end of file diff --git a/docs/.vuepress/public/img/bg.jpeg b/docs/.vuepress/public/img/bg.jpeg new file mode 100644 index 0000000..85e53e7 Binary files /dev/null and b/docs/.vuepress/public/img/bg.jpeg differ diff --git a/docs/.vuepress/public/img/bg.jpg b/docs/.vuepress/public/img/bg.jpg new file mode 100644 index 0000000..f093e79 Binary files /dev/null and b/docs/.vuepress/public/img/bg.jpg differ diff --git a/docs/.vuepress/public/img/favicon.ico b/docs/.vuepress/public/img/favicon.ico new file mode 100644 index 0000000..10bed8f Binary files /dev/null and b/docs/.vuepress/public/img/favicon.ico differ diff --git a/docs/.vuepress/public/img/logo.png b/docs/.vuepress/public/img/logo.png new file mode 100644 index 0000000..3c27e5a Binary files /dev/null and b/docs/.vuepress/public/img/logo.png differ diff --git a/docs/.vuepress/public/img/more.png b/docs/.vuepress/public/img/more.png new file mode 100644 index 0000000..830613b Binary files /dev/null and b/docs/.vuepress/public/img/more.png differ diff --git a/docs/.vuepress/public/img/other.png b/docs/.vuepress/public/img/other.png new file mode 100644 index 0000000..87f8098 Binary files /dev/null and b/docs/.vuepress/public/img/other.png differ diff --git a/docs/.vuepress/public/img/panda-waving.png b/docs/.vuepress/public/img/panda-waving.png new file mode 100644 index 0000000..20246c6 Binary files /dev/null and b/docs/.vuepress/public/img/panda-waving.png differ diff --git a/docs/.vuepress/public/img/python.png b/docs/.vuepress/public/img/python.png new file mode 100644 index 0000000..c3ddebe Binary files /dev/null and b/docs/.vuepress/public/img/python.png differ diff --git a/docs/.vuepress/public/img/ui.png b/docs/.vuepress/public/img/ui.png new file mode 100644 index 0000000..617c56d Binary files /dev/null and b/docs/.vuepress/public/img/ui.png differ diff --git a/docs/.vuepress/public/img/web.png b/docs/.vuepress/public/img/web.png new file mode 100644 index 0000000..3c27e5a Binary files /dev/null and b/docs/.vuepress/public/img/web.png differ diff --git a/docs/.vuepress/public/markmap/01.html b/docs/.vuepress/public/markmap/01.html new file mode 100644 index 0000000..ce015bd --- /dev/null +++ b/docs/.vuepress/public/markmap/01.html @@ -0,0 +1,25 @@ + + + + + + +Markmap + + + + + + + + diff --git "a/docs/.vuepress/public/markmap/\346\266\210\346\201\257\344\270\255\351\227\264\344\273\266.html" "b/docs/.vuepress/public/markmap/\346\266\210\346\201\257\344\270\255\351\227\264\344\273\266.html" new file mode 100644 index 0000000..19a70ea --- /dev/null +++ "b/docs/.vuepress/public/markmap/\346\266\210\346\201\257\344\270\255\351\227\264\344\273\266.html" @@ -0,0 +1,25 @@ + + + + + + +Markmap + + + + + + + + diff --git "a/docs/.vuepress/public/markmap/\346\266\210\346\201\257\344\270\255\351\227\264\344\273\266.md" "b/docs/.vuepress/public/markmap/\346\266\210\346\201\257\344\270\255\351\227\264\344\273\266.md" new file mode 100644 index 0000000..f9796a5 --- /dev/null +++ "b/docs/.vuepress/public/markmap/\346\266\210\346\201\257\344\270\255\351\227\264\344\273\266.md" @@ -0,0 +1,55 @@ +# 中间件技术 + +## 分布式消息中间件 + +- ActiveMQ +- RabbitMQ +- Kafka +- RocketMQ +- 场景 + - 消息中间件监控数据 + - 异步数据传输场景 + - 削峰填谷场景 + - 任务调度场景 + - 海量数据同步场景 + - 分布式事务场景 + - 日记管理场景 + - 大数据分析场景 +- + - AMQP + - MQTT + - 持久化设计 + - Kafka协议 + - 消息分发设计 + - 高可用设计 + - 可靠性设计 + - 容错设计 + + + +## 负载均衡中间件 + +- Nginx +- LVS负载均衡软件 +- KeepAlive +- CDN + +## 缓存中间件 + +- MemCache +- Redis + +## 数据库中间件 + +- Mycat +- ShardingJdbc + +## 案例分析 + +- 异步数据报错 +- 订单数据的消息分发 +- 分布式事务 +- 消息的容错 +- 分布式锁 +- 分布式会话 +- 分库分表 \ No newline at end of file diff --git a/docs/.vuepress/styles/index.styl b/docs/.vuepress/styles/index.styl new file mode 100644 index 0000000..78572bd --- /dev/null +++ b/docs/.vuepress/styles/index.styl @@ -0,0 +1,72 @@ + +// 评论区颜色重置 +.gt-container + .gt-ico-tip + &::after + content: '。( Win + . ) 或 ( ⌃ + ⌘ + ␣ ) 打开表情' + color: #999 + font-size: .8rem + .gt-meta + border-color var(--borderColor)!important + .gt-comments-null + color var(--textColor) + opacity .5 + .gt-header-textarea + color var(--textColor) + background rgba(180,180,180,0.1)!important + .gt-btn + border-color $accentColor!important + background-color $accentColor!important + .gt-btn-preview + background-color rgba(255,255,255,0)!important + color $accentColor!important + a + color $accentColor!important + .gt-svg svg + fill $accentColor!important + .gt-comment-content,.gt-comment-admin .gt-comment-content + background-color rgba(150,150,150,0.1)!important + &:hover + box-shadow 0 0 25px rgba(150,150,150,.5)!important + .gt-comment-body + color var(--textColor)!important + + +// qq徽章 +.qq + position: relative; +.qq::after + content: "可撩"; + background: $accentColor; + color:#fff; + padding: 0 5px; + border-radius: 10px; + font-size:12px; + position: absolute; + top: -4px; + right: -35px; + transform:scale(0.85); + +// demo模块图标颜色 +body .vuepress-plugin-demo-block__wrapper + &,.vuepress-plugin-demo-block__display + border-color rgba(160,160,160,.3) + .vuepress-plugin-demo-block__footer:hover + .vuepress-plugin-demo-block__expand::before + border-top-color: $accentColor !important; + border-bottom-color: $accentColor !important; + svg + fill: $accentColor !important; + +// 全文搜索框 +.suggestions + overflow: auto + max-height: calc(100vh - 6rem) + @media (max-width: 719px) { + width: 90vw; + min-width: 90vw!important; + margin-right: -20px; + } + .highlight + color: $accentColor + font-weight: bold diff --git a/docs/.vuepress/styles/palette.styl b/docs/.vuepress/styles/palette.styl new file mode 100644 index 0000000..0327ded --- /dev/null +++ b/docs/.vuepress/styles/palette.styl @@ -0,0 +1,64 @@ +//***vdoing主题-样式变量(你可以修改这些变量值以覆盖主题使用的样式变量)***// + +// 以下注释的变量仅供参考,主题使用的最新变量请查看:https://github.com/xugaoyi/vuepress-theme-vdoing/blob/master/theme-vdoing/styles/palette.styl + +// // 颜色 + +// $bannerTextColor = #fff // 首页banner区(博客标题)文本颜色 +// $accentColor = #11A8CD // 主题色 +// $activeColor = #ff5722 +// $arrowBgColor = #ccc + +// // 布局 +// $navbarHeight = 3.6rem +// $sidebarWidth = 18rem +// $contentWidth = 860px +// $homePageWidth = 1100px +// $rightMenuWidth = 230px // 右侧菜单 + +// // 代码块 +// $lineNumbersWrapperWidth = 2.5rem + +// // 浅色模式 +//.theme-mode-light +// --bodyBg: #fff +// --mainBg: rgba(255,255,255,1) +// --sidebarBg: rgba(255,255,255,.8) +// --blurBg: rgba(255,255,255,.9) +// --textColor: #004050 +// --textLightenColor: #0085AD +// --borderColor: rgba(0,0,0,.15) +// // 代码块浅色主题 +// --codeBg: #f6f6f6 +// --codeColor: #525252 +// codeThemeLight() +// // // 代码块深色主题 +// // --codeBg: #252526 +// // --codeColor: #fff +// // codeThemeDark() + +// // 深色模式 +// .theme-mode-dark +// --bodyBg: rgb(39,39,43) +// --mainBg: rgba(30,30,34,1) +// --sidebarBg: rgba(30,30,34,.8) +// --blurBg: rgba(30,30,34,.8) +// --textColor: rgb(140,140,150) +// --textLightenColor: #0085AD +// --borderColor: #2C2C3A +// --codeBg: #252526 +// --codeColor: #fff +// codeThemeDark() + +// // 阅读模式 +// .theme-mode-read +// --bodyBg: rgb(240,240,208) +// --mainBg: rgba(245,245,213,1) +// --sidebarBg: rgba(245,245,213,.8) +// --blurBg: rgba(245,245,213,.9) +// --textColor: #004050 +// --textLightenColor: #0085AD +// --borderColor: rgba(0,0,0,.15) +// --codeBg: #282c34 +// --codeColor: #fff +// codeThemeDark() diff --git "a/docs/01.\346\226\207\346\241\243/01.Campus\344\273\213\347\273\215/02.\351\241\271\347\233\256\347\256\200\344\273\213.md" "b/docs/01.\346\226\207\346\241\243/01.Campus\344\273\213\347\273\215/02.\351\241\271\347\233\256\347\256\200\344\273\213.md" new file mode 100644 index 0000000..4a457a4 --- /dev/null +++ "b/docs/01.\346\226\207\346\241\243/01.Campus\344\273\213\347\273\215/02.\351\241\271\347\233\256\347\256\200\344\273\213.md" @@ -0,0 +1,57 @@ +--- +title: 项目简介 +permalink: /campus +date: 2023-02-16 18:26:57 +--- + + +

+ oddfar +

+ +## 项目简介 + + + +::: tip +想重构之前的校园信息墙项目,又想学习若依项目,就手写了若依并修改了部分功能,于是有了这套后台系统,所以取名为campus +::: + +**Campus** 一款简单的后台管理系统,快速开发框架,适合大学生开发毕设,或其他小项目。 + +使用Spring Boot、Spring Security、MyBatis、Jwt、Vue等技术 + + + + + +## 项目演示 + +- 站点演示: + +后台: + +- 项目地址 + +目前项目托管在 **Gitee**、**GitHub**平台上中,开源不易,欢迎大家 **Star** 和 **Fork** 支持~ + +Gitee: + +Github: + +## 贡献代码 + +若您有好的想法,发现一些 **BUG** 并修复了,欢迎提交 **Pull Request** 参与开源贡献 + +发起 pull request 请求,提交到 master 分支,等待作者合并 + +## 致谢 + +此项目参考了一些开源项目的解决方案,在此感谢他们的开源 + +- Vue后台管理模板:[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) +- RuoYi: +- RuoYi Pro: +- Guns: + + diff --git "a/docs/01.\346\226\207\346\241\243/05.\345\277\253\351\200\237\345\205\245\351\227\250/01.\347\216\257\345\242\203\345\207\206\345\244\207.md" "b/docs/01.\346\226\207\346\241\243/05.\345\277\253\351\200\237\345\205\245\351\227\250/01.\347\216\257\345\242\203\345\207\206\345\244\207.md" new file mode 100644 index 0000000..7f323d0 --- /dev/null +++ "b/docs/01.\346\226\207\346\241\243/05.\345\277\253\351\200\237\345\205\245\351\227\250/01.\347\216\257\345\242\203\345\207\206\345\244\207.md" @@ -0,0 +1,43 @@ +--- +title: 环境准备 +date: 2023-02-17 00:14:43 +permalink: /pages/747f41/ +--- + +确保安装并正确配置一下软件: + +## 后端环境 + +- JDK1.8 + +- Maven + + 需替换成阿里云镜像加速 + + ```xml + + + alimaven + aliyun maven + http://maven.aliyun.com/nexus/content/groups/public/ + central + + + ``` + + + +- mysql 5.7 + +- Redis + + win版本: + + 运行文件夹下面的`redis-server.exe`即可启动 + +- IDEA需安装LOMBOOK插件 + +## 前端环境 + +- Node Js 16或以上版本。 + diff --git a/docs/@pages/archivesPage.md b/docs/@pages/archivesPage.md new file mode 100644 index 0000000..c021f6b --- /dev/null +++ b/docs/@pages/archivesPage.md @@ -0,0 +1,6 @@ +--- +archivesPage: true +title: 归档 +permalink: /archives/ +article: false +--- \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..155fca5 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,27 @@ +--- +home: true +heroImage: /img/web.png +heroText: Campus +tagline: 🚀使用此项目快速开发毕设 +actionText: 立刻进入 → +actionLink: /campus/ +bannerBg: none +# bannerBg: auto # auto => 网格纹背景(有bodyBgImg时无背景),默认 | none => 无 | '大图地址' | background: 自定义背景样式 提示:如发现文本颜色不适应你的背景时可以到palette.styl修改$bannerTextColor变量 + +features: # 可选的 + - title: 前后端分离 + details: 前端使用Vue、Element, 后端使用spring boot + mybatis-plus进行开发。 + - title: 快速开发 + details: 代码简洁通俗易懂,有极低的学习成本,适合大学生快速开发毕设。 + - title: 功能待完善 + details: 后续功能慢慢更新中...... + +# 文章列表显示方式: detailed 默认,显示详细版文章列表(包括作者、分类、标签、摘要、分页等)| simple => 显示简约版文章列表(仅标题和日期)| none 不显示文章列表 +postList: none +# simplePostListLength: 10 # 简约版文章列表显示的文章数量,默认10。(仅在postList设置为simple时生效) +# hideRightBar: true # 是否隐藏右侧边栏 +--- + + + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..2980b34 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "theme-vdoing-blog", + "version": "1.0.0", + "scripts": { + "dev": "vuepress dev docs", + "build": "vuepress build docs", + "deploy": "bash deploy.sh", + "editFm": "node utils/editFrontmatter.js" + }, + "license": "MIT", + "devDependencies": { + "inquirer": "^7.1.0", + "json2yaml": "^1.1.0", + "moment": "^2.25.3", + "vuepress": "^1.4.1", + "vuepress-plugin-demo-block": "^0.7.2", + "vuepress-plugin-fulltext-search": "^2.2.1", + "vuepress-plugin-one-click-copy": "^1.0.3", + "vuepress-plugin-thirdparty-search": "^1.0.2", + "vuepress-plugin-zooming": "^1.1.7", + "vuepress-theme-vdoing": "^1.12.8", + "yamljs": "^0.3.0" + }, + "dependencies": { + "@vssue/api-github-v3": "^1.4.7", + "@vssue/vuepress-plugin-vssue": "^1.4.8" + } +} diff --git a/utils/baiduPush.js b/utils/baiduPush.js new file mode 100644 index 0000000..7ed2df0 --- /dev/null +++ b/utils/baiduPush.js @@ -0,0 +1,35 @@ +/** + * 生成百度链接推送文件 + */ +const fs = require('fs'); +const path = require('path'); +const chalk = require('chalk') +const matter = require('gray-matter'); // FrontMatter解析器 https://github.com/jonschlinkert/gray-matter +const readFileList = require('./modules/readFileList'); +const urlsRoot = path.join(__dirname, '..', 'urls.txt'); // 百度链接推送文件 +const DOMAIN = process.argv.splice(2)[0]; // 获取命令行传入的参数 + +if (!DOMAIN) { + console.log(chalk.red('请在运行此文件时指定一个你要进行百度推送的域名参数,例:node utils/baiduPush.js https://xugaoyi.com')) + return +} + +main(); + +/** + * 主体函数 + */ +function main() { + fs.writeFileSync(urlsRoot, DOMAIN) + const files = readFileList(); // 读取所有md文件数据 + + files.forEach( file => { + const { data } = matter(fs.readFileSync(file.filePath, 'utf8')); + + if (data.permalink) { + const link = `\r\n${DOMAIN}${data.permalink}`; + console.log(link) + fs.appendFileSync(urlsRoot, link); + } + }) +} diff --git a/utils/config.yml b/utils/config.yml new file mode 100644 index 0000000..e0f3293 --- /dev/null +++ b/utils/config.yml @@ -0,0 +1,16 @@ +#批量添加和修改、删除front matter配置文件 + +# 需要批量处理的路径,docs文件夹内的文件夹 (数组。映射路径:docs/arr[0]/arr[1] ... ) +path: + - docs # 第一个成员必须是docs + - 01.前端 + - 40.学习笔记 + +# 要删除的字段 (数组) +delete: + - test + # - tags + + # 要添加、修改front matter的数据 (front matter中没有的数据则添加,已有的数据则覆盖) +data: + # test: 阮一峰 \ No newline at end of file diff --git a/utils/editFrontmatter.js b/utils/editFrontmatter.js new file mode 100644 index 0000000..8c223f4 --- /dev/null +++ b/utils/editFrontmatter.js @@ -0,0 +1,92 @@ +/** + * 批量添加和修改front matter ,需要配置 ./config.yml 文件。 + */ +const fs = require('fs'); // 文件模块 +const path = require('path'); // 路径模块 +const matter = require('gray-matter'); // front matter解析器 https://github.com/jonschlinkert/gray-matter +const jsonToYaml = require('json2yaml') +const yamlToJs = require('yamljs') +const inquirer = require('inquirer') // 命令行操作 +const chalk = require('chalk') // 命令行打印美化 +const readFileList = require('./modules/readFileList'); +const { type, repairDate} = require('./modules/fn'); +const log = console.log + +const configPath = path.join(__dirname, 'config.yml') // 配置文件的路径 + +main(); + +/** + * 主体函数 + */ +async function main() { + + const promptList = [{ + type: "confirm", + message: chalk.yellow('批量操作frontmatter有修改数据的风险,确定要继续吗?'), + name: "edit", + }]; + let edit = true; + + await inquirer.prompt(promptList).then(answers => { + edit = answers.edit + }) + + if(!edit) { // 退出操作 + return + } + + const config = yamlToJs.load(configPath) // 解析配置文件的数据转为js对象 + + if (type(config.path) !== 'array') { + log(chalk.red('路径配置有误,path字段应该是一个数组')) + return + } + + if (config.path[0] !== 'docs') { + log(chalk.red("路径配置有误,path数组的第一个成员必须是'docs'")) + return + } + + const filePath = path.join(__dirname, '..', ...config.path); // 要批量修改的文件路径 + const files = readFileList(filePath); // 读取所有md文件数据 + + files.forEach(file => { + let dataStr = fs.readFileSync(file.filePath, 'utf8');// 读取每个md文件的内容 + const fileMatterObj = matter(dataStr) // 解析md文件的front Matter。 fileMatterObj => {content:'剔除frontmatter后的文件内容字符串', data:{}, ...} + let matterData = fileMatterObj.data; // 得到md文件的front Matter + + let mark = false + // 删除操作 + if (config.delete) { + if( type(config.delete) !== 'array' ) { + log(chalk.yellow('未能完成删除操作,delete字段的值应该是一个数组!')) + } else { + config.delete.forEach(item => { + if (matterData[item]) { + delete matterData[item] + mark = true + } + }) + + } + } + + // 添加、修改操作 + if (type(config.data) === 'object') { + Object.assign(matterData, config.data) // 将配置数据合并到front Matter对象 + mark = true + } + + // 有操作时才继续 + if (mark) { + if(matterData.date && type(matterData.date) === 'date') { + matterData.date = repairDate(matterData.date) // 修复时间格式 + } + const newData = jsonToYaml.stringify(matterData).replace(/\n\s{2}/g,"\n").replace(/"/g,"") + '---\r\n' + fileMatterObj.content; + fs.writeFileSync(file.filePath, newData); // 写入 + log(chalk.green(`update frontmatter:${file.filePath} `)) + } + + }) +} diff --git a/utils/modules/fn.js b/utils/modules/fn.js new file mode 100644 index 0000000..48cbbd1 --- /dev/null +++ b/utils/modules/fn.js @@ -0,0 +1,21 @@ +// 类型判断 +exports.type = function (o){ + var s = Object.prototype.toString.call(o) + return s.match(/\[object (.*?)\]/)[1].toLowerCase() +} + + // 修复date时区格式的问题 + exports.repairDate = function (date) { + date = new Date(date); + return `${date.getUTCFullYear()}-${zero(date.getUTCMonth()+1)}-${zero(date.getUTCDate())} ${zero(date.getUTCHours())}:${zero(date.getUTCMinutes())}:${zero(date.getUTCSeconds())}`; +} + +// 日期的格式 +exports.dateFormat = function (date) { + return `${date.getFullYear()}-${zero(date.getMonth()+1)}-${zero(date.getDate())} ${zero(date.getHours())}:${zero(date.getMinutes())}:${zero(date.getSeconds())}` +} + +// 小于10补0 +function zero(d){ + return d.toString().padStart(2,'0') +} \ No newline at end of file diff --git a/utils/modules/readFileList.js b/utils/modules/readFileList.js new file mode 100644 index 0000000..8eb97c6 --- /dev/null +++ b/utils/modules/readFileList.js @@ -0,0 +1,43 @@ +/** + * 读取所有md文件数据 + */ +const fs = require('fs'); // 文件模块 +const path = require('path'); // 路径模块 +const docsRoot = path.join(__dirname, '..', '..', 'docs'); // docs文件路径 + +function readFileList(dir = docsRoot, filesList = []) { + const files = fs.readdirSync(dir); + files.forEach( (item, index) => { + let filePath = path.join(dir, item); + const stat = fs.statSync(filePath); + if (stat.isDirectory() && item !== '.vuepress') { + readFileList(path.join(dir, item), filesList); //递归读取文件 + } else { + if(path.basename(dir) !== 'docs'){ // 过滤docs目录级下的文件 + + const fileNameArr = path.basename(filePath).split('.') + let name = null, type = null; + if (fileNameArr.length === 2) { // 没有序号的文件 + name = fileNameArr[0] + type = fileNameArr[1] + } else if (fileNameArr.length === 3) { // 有序号的文件 + name = fileNameArr[1] + type = fileNameArr[2] + } else { // 超过两个‘.’的 + log(chalk.yellow(`warning: 该文件 "${filePath}" 没有按照约定命名,将忽略生成相应数据。`)) + return + } + if(type === 'md'){ // 过滤非md文件 + filesList.push({ + name, + filePath + }); + } + + } + } + }); + return filesList; +} + +module.exports = readFileList; \ No newline at end of file