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 8e3c7a1..382bc2f 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,12 +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', + // lastUpdated: 'Last Updated', head: [ ['link', {rel: 'icon', href: '/logo.png'}], ], @@ -24,7 +26,7 @@ module.exports = { // }, {text: "博客", link: "https://blog.isww.cn/"} ], - sidebarDepth: 4, + sidebarDepth: 2, // 设置侧边栏内容 sidebar: [ { @@ -33,23 +35,22 @@ module.exports = { children: [ '/wiki/introduce/', '/wiki/back-build/', - { - title: "侧边栏组合", - collapsable: false, - children: [ - "/second/child/" - ] - } + // { + // title: "侧边栏组合", + // collapsable: false, + // children: [ + // "/second/child/" + // ] + // } + ] // 根据自己的需求来订,对应自己在docs下的文件夹名,默认首页是README.md + }, + { + title: '教程', + collapsable: false, + children: [ + '/document/' ] // 根据自己的需求来订,对应自己在docs下的文件夹名,默认首页是README.md }, - // { - // title: '使用教程', - // collapsable: false, - // children: [ - // '/document/', - // - // ] - // }, ] } }; 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/document/README.md b/docs/document/README.md index dbd415c..61ab24f 100644 --- a/docs/document/README.md +++ b/docs/document/README.md @@ -1,4 +1,42 @@ # config.js配置教程 + +## 设置站点根路径 +- 如果访问的时候是ip+端口,那么这里就是**/**,如果访问的是ip+端口+工程名,那么这里就是 **/工程名/** +- 这是部署到github相关的配置 + +``` +module.exports = { + base:'/', + } +``` + +## 设置编译后的输出目录 +- **./ROOT**代表在工程的根目录下生成一个ROOT文件,里面是编译好的文件,可以拿ROOT直接部署。 + +``` +module.exports = { + dest:'./ROOT', + } +``` + +## 本地调试的端口号,默认是8080 + +``` +module.exports = { + port:8086, + } +``` + +## 代码块显示行号 + +``` +module.exports = { +markdown: { + lineNumbers: true // 代码块显示行号 + } +} +``` + ## 页面路由地址对应写法 | 文件的相对路径 | 页面路由地址 | @@ -7,19 +45,81 @@ | /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配置【右上角的导航条】 ``` -nav: +themeConfig: { + nav: [ {text: "首页", link: "/"}, {text: "指南", link: "/wiki/introduce/"}, {text: "博客", link: "https://blog.isww.cn/"} ], +} ``` -## 侧边栏配置 -### 设置侧边栏最大深度 sidebarDepth: 4 -- 一般是以单个md文件中的 # ## ### #### 这几个标题文字为锚点自动生成导航 -- 0读取1级标题 1读取1级和2级标题 2读取1级、2级、3级标题 -### 设置侧边栏内容 +## 侧边栏配置 +### 设置左侧导航显示的层级 +- 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