diff --git a/.vuepress/components/AdSenseBanner.vue b/.vuepress/components/AdSenseBanner.vue index 7ffad89..32f3347 100644 --- a/.vuepress/components/AdSenseBanner.vue +++ b/.vuepress/components/AdSenseBanner.vue @@ -1,5 +1,5 @@ @@ -64,15 +64,9 @@ export default { } }, mounted () { - if (typeof window !== 'undefined') { - if (location.search !== undefined && location.search.indexOf('sharing') >= 0) { - // 如果带参数 sharing,则设置 $frontmatter.isSharing = true - this.$set(this, 'isNotSharing', false) - document.title = this.$frontmatter.sharingTitle || this.$page.title - this.$frontmatter.title = this.$frontmatter.sharingTitle - } else { - this.$set(this, 'isNotSharing', true) - } + if (!this.$isNotSharing) { + document.title = this.$frontmatter.sharingTitle || this.$page.title + this.$frontmatter.title = this.$frontmatter.sharingTitle } } } diff --git a/.vuepress/theme/components/Sidebar.vue b/.vuepress/theme/components/Sidebar.vue index acf7519..27a58e6 100644 --- a/.vuepress/theme/components/Sidebar.vue +++ b/.vuepress/theme/components/Sidebar.vue @@ -3,19 +3,19 @@
- 简介 + 简介
- 安装 + 安装
- 学习 + 学习
- 使用 + 使用
- 支持 + 支持
@@ -65,6 +65,11 @@ export default { demo_img: demo } }, + computed: { + urlSurfix () { + return this.$isNotSharing ? '' : '?sharing=true' + } + }, methods: { activeLinkStyle(href) { if (this.$page.path.indexOf(href) === 0) { diff --git a/docker/ClientComputedMixin.js b/docker/ClientComputedMixin.js index bfedc56..9798f79 100644 --- a/docker/ClientComputedMixin.js +++ b/docker/ClientComputedMixin.js @@ -80,7 +80,18 @@ module.exports = siteData => { if (page.frontmatter.titlePrefix !== undefined) { selfTitle = page.frontmatter.titlePrefix + '_' + selfTitle } - if (page.path.indexOf('/learning/') === 0 && !page.frontmatter.isSharing) { + + let isNotSharing = true + if (typeof window !== 'undefined') { + if (location.search !== undefined && location.search.indexOf('sharing') >= 0) { + // 如果带参数 sharing,则设置 isNotSharing = false + isNotSharing = false + } else { + isNotSharing = true + } + } + + if (page.path.indexOf('/learning/') === 0 && isNotSharing) { return selfTitle + '_Kubernetes教程_K8S教程_K8S培训' } if (page.path.indexOf('/install/') === 0) { diff --git a/install/install-k8s.md b/install/install-k8s.md index bbc8887..c2424af 100644 --- a/install/install-k8s.md +++ b/install/install-k8s.md @@ -37,7 +37,7 @@ meta: ## 文档特点 - + diff --git a/package-lock.json b/package-lock.json index c57f28e..822eaf0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1556,10 +1556,19 @@ "resolved": "https://registry.npm.taobao.org/alphanum-sort/download/alphanum-sort-1.0.2.tgz", "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=" }, - "animate.css": { - "version": "3.7.2", - "resolved": "https://registry.npm.taobao.org/animate.css/download/animate.css-3.7.2.tgz", - "integrity": "sha1-5z4NUOkssc/vFZfZs4qUgQIOCOo=" + "animated-number-vue": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/animated-number-vue/download/animated-number-vue-1.0.0.tgz", + "integrity": "sha1-RHznj8EMfyx33wykVKG8GAUuv8g=", + "requires": { + "animejs": "^2.2.0", + "vue": "^2.5.13" + } + }, + "animejs": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/animejs/download/animejs-2.2.0.tgz", + "integrity": "sha1-Ne79/FNbgZScnLBvCz5gwC5v3IA=" }, "ansi-colors": { "version": "3.2.4", @@ -12146,13 +12155,10 @@ "resolved": "https://registry.npm.taobao.org/vue-template-es2015-compiler/download/vue-template-es2015-compiler-1.9.1.tgz", "integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=" }, - "vueg": { - "version": "1.4.5", - "resolved": "https://registry.npm.taobao.org/vueg/download/vueg-1.4.5.tgz", - "integrity": "sha1-UtVOEezeHmljaKJHpKoJ2Dbr+oQ=", - "requires": { - "animate.css": "^3.7.0" - } + "vue2-animate": { + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/vue2-animate/download/vue2-animate-2.1.2.tgz", + "integrity": "sha1-i34JRyKPHrGcKxYF3hJRQdM1jSI=" }, "vuepress": { "version": "1.2.0", diff --git a/package.json b/package.json index 83dcb8f..9d141cb 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,12 @@ }, "dependencies": { "@vuepress/plugin-pwa": "^1.2.0", + "animated-number-vue": "^1.0.0", "element-ui": "^2.12.0", "esm": "^3.2.25", "npm": "^6.11.3", "reduce-css-calc": "^2.1.6", - "vueg": "^1.4.5", + "vue2-animate": "^2.1.2", "vuepress": "^1.2.0", "vuepress-plugin-named-chunks": "^1.0.2" }