From a601a83c0e5ed278dd61107d0c62e097ee7aedfb Mon Sep 17 00:00:00 2001 From: Kang HuaiShuai Date: Mon, 9 Dec 2019 13:40:10 +0800 Subject: [PATCH] Update vuepress Signed-off-by: Kang HuaiShuai --- .github/workflows/ci.yaml | 4 +- .gitignore | 3 + .vuepress/config.js | 199 +++++++++++++++++++++---------------- kubernetes/setup/docker.md | 2 +- package.json | 28 ++++++ 5 files changed, 150 insertions(+), 86 deletions(-) create mode 100644 package.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 96f5b83..dab00ad 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,9 @@ jobs: - name: vuepress run: | sudo rm -rf _book - npx vuepress build + npm i vuepress --save-dev + npm i + npm run vuepress:build echo "vuepress.docker-practice.com" > .vuepress/dist/CNAME - name: Upload Vuepress dist uses: docker://pcit/pages diff --git a/.gitignore b/.gitignore index 5bd7cae..4d19753 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,8 @@ _book/ *.swp *.edx .DS_Store + node_modules/ +package-lock.json + .vuepress/dist diff --git a/.vuepress/config.js b/.vuepress/config.js index 79320df..9edef45 100644 --- a/.vuepress/config.js +++ b/.vuepress/config.js @@ -1,58 +1,89 @@ module.exports = { title: 'Docker 从入门到实践', base: '/', + head: [['script', {}, ` + var _hmt = _hmt || []; + (function() { + var hm = document.createElement("script"); + hm.src = "//hm.baidu.com/hm.js?81a3490c9cd141dbcf6d00bc18b6edae"; + var s = document.getElementsByTagName("script")[0]; + s.parentNode.insertBefore(hm, s); + })(); +`], + [ + 'script', {}, ` + (function(){ + var bp = document.createElement('script'); + var curProtocol = window.location.protocol.split(':')[0]; + if (curProtocol === 'https') { + bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; + } + else { + bp.src = 'http://push.zhanzhang.baidu.com/push.js'; + } + var s = document.getElementsByTagName("script")[0]; + s.parentNode.insertBefore(bp, s); +})(); + ` + ] + ], + plugins: { + sitemap: { + hostname: 'https://vuepress.mirror.docker-practice.com' + }, + }, themeConfig: { docsRepo: 'yeasy/docker_practice', docsDir: '/', editLinks: true, nav: [{ - text: '安装 Docker', - link: '/install/', - }, - { - text: 'Docker 入门', - link: '/' - }, - { - text: 'Docker 实战', - link: '/cases/os/' - }, - { - text: 'CI/CD', - link: '/cases/ci/' - }, - { - text: 'Docker 仓库', - link: '/repository/' - }, - { - text: '底层实现', - link: '/underly/', - }, - { - text: 'Compose', - link: '/compose/', - }, - { - text: 'Kubernetes', - link: '/kubernetes/', - }, - { - text: "云计算", - link: "/cloud/", - }, - { - text: 'GitHub', - link: 'https://github.com/yeasy/docker_practice' - }, - // { - // text: '捐赠', - // link: '' - // }, - { - text: '腾讯云容器服务', - link: 'https://cloud.tencent.com/redirect.php?redirect=10058&cps_key=3a5255852d5db99dcd5da4c72f05df61' - }, + text: '安装 Docker', + link: '/install/', + }, + { + text: 'Docker 入门', + link: '/' + }, + { + text: 'Docker 实战', + link: '/cases/os/' + }, + { + text: 'CI/CD', + link: '/cases/ci/' + }, + { + text: 'Docker 仓库', + link: '/repository/' + }, + { + text: '底层实现', + link: '/underly/', + }, + { + text: 'Compose', + link: '/compose/', + }, + { + text: 'Kubernetes', + link: '/kubernetes/', + }, + { + text: "云计算", + link: "/cloud/", + }, + { + text: 'GitHub', + link: 'https://github.com/yeasy/docker_practice' + }, + // { + // text: '捐赠', + // link: '' + // }, + { + text: '腾讯云容器服务', + link: 'https://cloud.tencent.com/redirect.php?redirect=10058&cps_key=3a5255852d5db99dcd5da4c72f05df61' + }, // { // text: '语言', // items: [{ @@ -84,7 +115,7 @@ module.exports = { }, { title: "Kubernetes 命令行 kubectl", - collapsable:false, + collapsable: false, children: [ 'kubectl/' ] @@ -101,23 +132,23 @@ module.exports = { 'wordpress', ], '/install/': [ - 'ubuntu', - 'debian', - 'fedora', - 'centos', - 'raspberry-pi', - 'mac', - 'windows', - 'mirror', - 'experimental', + 'ubuntu', + 'debian', + 'fedora', + 'centos', + 'raspberry-pi', + 'mac', + 'windows', + 'mirror', + 'experimental', ], '/underly/': [ - 'arch', - 'namespace', - 'cgroups', - 'ufs', - 'container_format', - 'network', + 'arch', + 'namespace', + 'cgroups', + 'ufs', + 'container_format', + 'network', ], '/repository/': [ 'dockerhub', @@ -128,7 +159,7 @@ module.exports = { '/cases/os/': [ { title: "操作系统", - collapsable:false, + collapsable: false, children: [ 'busybox', 'alpine', @@ -162,7 +193,7 @@ module.exports = { '/', '/CHANGELOG', '/CONTRIBUTING', - { + { title: "Docker 简介", collapsable: false, children: [ @@ -170,7 +201,7 @@ module.exports = { 'introduction/what', 'introduction/why', ] - },{ + }, { title: "基本概念", collapsable: false, children: [ @@ -216,7 +247,7 @@ module.exports = { 'image/multistage-builds/laravel', 'image/manifest', ] - },{ + }, { title: "操作容器", collapsable: false, children: [ @@ -231,25 +262,25 @@ module.exports = { }, { title: "数据管理", - collapsable:false, + collapsable: false, children: [ 'data_management/', 'data_management/volume', 'data_management/bind-mounts', ], - },{ - title: "使用网络", - collapsable:false, - children: [ - 'network/', - 'network/port_mapping', - 'network/linking', - 'network/dns', - ], + }, { + title: "使用网络", + collapsable: false, + children: [ + 'network/', + 'network/port_mapping', + 'network/linking', + 'network/dns', + ], }, { title: "高级网络配置", - collapsable:false, + collapsable: false, children: [ 'advanced_network/', 'advanced_network/quick_guide', @@ -263,7 +294,7 @@ module.exports = { }, { title: "Swarm mode", - collapsable:false, + collapsable: false, children: [ 'swarm_mode/', 'swarm_mode/overview', @@ -300,7 +331,7 @@ module.exports = { }, { title: "Etcd", - collapsable:false, + collapsable: false, children: [ 'etcd/', 'etcd/intro', @@ -320,10 +351,10 @@ module.exports = { }, { title: "Docker 开源项目", - collapsable:false, - children:[ - 'opensource/', - 'opensource/linuxkit', + collapsable: false, + children: [ + 'opensource/', + 'opensource/linuxkit', ], }, 'appendix/faq/', diff --git a/kubernetes/setup/docker.md b/kubernetes/setup/docker.md index 6f27a75..fede455 100644 --- a/kubernetes/setup/docker.md +++ b/kubernetes/setup/docker.md @@ -8,7 +8,7 @@ Kubernetes 依赖 Etcd 服务来维护所有主节点的状态。 -## 启动 Etcd 服务。 +## 启动 Etcd 服务 ```bash docker run --net=host -d gcr.io/google_containers/etcd:2.0.9 /usr/local/bin/etcd --addr=127.0.0.1:4001 --bind-addr=0.0.0.0:4001 --data-dir=/var/etcd/data diff --git a/package.json b/package.json new file mode 100644 index 0000000..66a88fc --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "docker_practice", + "version": "1.0.0", + "description": "docker_practice", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "chalk": "^3.0.0", + "commander": "^4.0.1", + "esm": "^3.2.25", + "vuepress-plugin-container": "^2.1.2", + "vuepress-plugin-sitemap": "^2.3.1" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "vuepress:build": "npx vuepress build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/yeasy/docker_practice.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/yeasy/docker_practice/issues" + }, + "homepage": "https://github.com/yeasy/docker_practice#readme" +}