diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 61589ea..0000000 --- a/.drone.yml +++ /dev/null @@ -1,40 +0,0 @@ -kind: pipeline -type: docker -name: cloud-security-wiki -steps: - - name: build-package-vue - image: node:14.20 - volumes: - - name: cache - path: /drone/src/node_modules - - name: build - path: /app/build - commands: - - npm -v - - mkdir -p ./node_modules - - export NODE_MODULES_PATH=`pwd`/node_modules - - npm config set registry https://registry.npm.taobao.org - - set NODE_OPTIONS=--openssl-legacy-provider - - npm install - - npm run docs:build - - ls - - echo $NODE_MODULES_PATH - - rm -rf /app/build/dist - - cp -r docs/.vuepress/dist /app/build/dist - - chmod 777 /app/build/dist - - -volumes: - - name: build - host: - path: /www/wwwroot/wiki - - name: cache - host: - path: /var/lib/npm/cache - -#trigger: -# branch: -# - dev-java -# - dev-vue -# event: -# - push diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index e920397..382bc2f 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,10 +1,14 @@ module.exports = { - title: "Cloud Security",// 文档标题,左上角显示 + title: "Cloud Security",// 设置文档标题,左上角显示 description: "Cloud Security", + plugins: ['@vuepress/back-to-top'],//此处是添加返回顶部的插件 markdown: { lineNumbers: true // 代码块显示行号 }, themeConfig: { + // logo:'/logo.png', + //最后更新时间 + // lastUpdated: 'Last Updated', head: [ ['link', {rel: 'icon', href: '/logo.png'}], ], @@ -22,34 +26,29 @@ module.exports = { // }, {text: "博客", link: "https://blog.isww.cn/"} ], - /** - * 设置侧边栏最大深度 - * 一般是以单个md文件中的 # ## ### #### 这几个标题文字为锚点自动生成导航 - * **/ - sidebarDepth: 4, - // sidebarDepth: 0, //0读取1级标题 1读取1级和2级标题 2读取1级、2级、3级标题 + sidebarDepth: 2, // 设置侧边栏内容 sidebar: [ - { - title: '教程', - collapsable: false, - children: [ - '/document/', - // { - // title: '侧边栏组合', - // // collapsable: true, - // children: [ - // '/second/child/' - // ] - // } - ] - }, { title: '文档', collapsable: false, children: [ '/wiki/introduce/', - '/wiki/back-build/' + '/wiki/back-build/', + // { + // title: "侧边栏组合", + // collapsable: false, + // children: [ + // "/second/child/" + // ] + // } + ] // 根据自己的需求来订,对应自己在docs下的文件夹名,默认首页是README.md + }, + { + title: '教程', + collapsable: false, + children: [ + '/document/' ] // 根据自己的需求来订,对应自己在docs下的文件夹名,默认首页是README.md }, ] diff --git a/docs/.vuepress/public/navLogo.png b/docs/.vuepress/public/navLogo.png new file mode 100644 index 0000000..0804ff9 Binary files /dev/null and b/docs/.vuepress/public/navLogo.png differ diff --git a/docs/.vuepress/public/sidebar.png b/docs/.vuepress/public/sidebar.png new file mode 100644 index 0000000..dc121cf Binary files /dev/null and b/docs/.vuepress/public/sidebar.png differ diff --git a/docs/README.md b/docs/README.md index 0b5c902..6635308 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,5 +10,5 @@ features: details: 享受 Vue + webpack 的开发体验,在 Markdown 中使用 Vue 组件,同时可以使用 Vue 来开发自定义主题。 - title: 高性能 details: VuePress 为每个页面预渲染生成静态的 HTML,同时在页面被加载的时候,将作为 SPA 运行。 - footer: MIT Licensed | Copyright © 2018-present Evan You +footer: MIT Licensed | Copyright © 2022-present Clay --- diff --git a/docs/document/README.md b/docs/document/README.md index 7845ed4..61ab24f 100644 --- a/docs/document/README.md +++ b/docs/document/README.md @@ -1,4 +1,125 @@ -# 首先 +# config.js配置教程 -## 其次 -固定侧边栏,不折叠显示: collapsable: false, +## 设置站点根路径 +- 如果访问的时候是ip+端口,那么这里就是**/**,如果访问的是ip+端口+工程名,那么这里就是 **/工程名/** +- 这是部署到github相关的配置 + +``` +module.exports = { + base:'/', + } +``` + +## 设置编译后的输出目录 +- **./ROOT**代表在工程的根目录下生成一个ROOT文件,里面是编译好的文件,可以拿ROOT直接部署。 + +``` +module.exports = { + dest:'./ROOT', + } +``` + +## 本地调试的端口号,默认是8080 + +``` +module.exports = { + port:8086, + } +``` + +## 代码块显示行号 + +``` +module.exports = { +markdown: { + lineNumbers: true // 代码块显示行号 + } +} +``` + +## 页面路由地址对应写法 + +| 文件的相对路径 | 页面路由地址 | +| :------------ | :------------ | +| /README.md | / | +| /guide/README.md | /guide/ | +| /config.md | /config.html | + +## 网页标签的图标 +- 这里的 '/' 指向 docs/.vuepress/public 文件目录 ,即 docs/.vuepress/public/logo.png + +``` +themeConfig: { + head: [ + ['link', {rel: 'icon', href: '/logo.png'}], + ], +} +``` + +## 导航栏Logo + +``` + themeConfig: { + logo:'/logo.png', +} +``` + +![](/navLogo.png) + +## nav配置【右上角的导航条】 + +``` +themeConfig: { + nav: + [ + {text: "首页", link: "/"}, + {text: "指南", link: "/wiki/introduce/"}, + {text: "博客", link: "https://blog.isww.cn/"} + ], +} +``` + +## 侧边栏配置 +### 设置左侧导航显示的层级 +- sidebarDepth: 2 +- 一般是以单个md文件中的 # ## ### #### 这几个标题文字为锚点自动生成导航 +- 0读取1级标题 +- 1读取1级和2级标题 +- 2读取1级、2级、3级标题 + +### 设置侧边栏内容 +- 根据自己的需求来订,对应自己在docs下的文件夹名,默认首页是README.md 【/wiki/introduce/ 相当于 /wiki/introduce/README.md】效果如下图: +- 【注】其中侧边栏除了config.js下的title外的导航栏目是根据该目录(例如:/wiki/introduce/)下的一级、二级、三级和四级标题所自动生成的导航栏目,所以**侧边栏只需要在config.js配置页面路由地址及title即可** + +``` +themeConfig: { +sidebar: [ + { + title: '文档', + collapsable: false, + children: [ + '/wiki/introduce/', + '/wiki/back-build/', + { + title: "侧边栏组合", + collapsable: false, + children: [ + "/second/child/" + ] + } + ] + }, + ] + } +``` + + + +## 底部设置最后更新时间 + +``` +themeConfig: { + //最后更新时间 + lastUpdated: 'Last Updated', +} +``` diff --git a/docs/second/child/README.md b/docs/second/child/README.md index e69de29..db465c2 100644 --- a/docs/second/child/README.md +++ b/docs/second/child/README.md @@ -0,0 +1,7 @@ +# 1共和国 +## 2 +### 3 + +#### 4 + +##### 5