Skip to content
Permalink
Browse files

fix: 添加seo支持和侧边栏友情链接

  • Loading branch information...
alterhu2020 committed Apr 26, 2019
1 parent 7265eda commit 6a8a203fbca171238bfa42f6a1e63f94f0e8d11e
Showing with 14,819 additions and 7 deletions.
  1. +16 −0 docs/.vuepress/config.js
  2. +21 −0 docs/.vuepress/enhanceApp.js
  3. +5 −2 docs/.vuepress/sidebar.js
  4. +14,770 −0 package-lock.json
  5. +7 −5 package.json
@@ -71,6 +71,19 @@ module.exports = {
'.vuepress/sidebar.js'
],
plugins: [
['vuepress-plugin-seo',{
siteTitle: (_, $site) => $site.title,
title: $page => $page.title,
description: $page => $page.frontmatter.description,
author: (_, $site) => $site.themeConfig.author,
tags: $page => $page.frontmatter.tags,
twitterCard: _ => 'summary_large_image',
type: $page => ['articles', 'posts', 'blog'].some(folder => $page.regularPath.startsWith('/' + folder)) ? 'article' : 'website',
url: (_, $site, path) => ($site.themeConfig.domain || '') + path,
image: ($page, $site) => $page.frontmatter.image && (($site.themeConfig.domain || '') + $page.frontmatter.image),
publishedAt: $page => $page.frontmatter.date && new Date($page.frontmatter.date),
modifiedAt: $page => $page.lastUpdated && new Date($page.lastUpdated)
}],
['@vuepress/google-analytics', {
ga: 'UA-122219517-1'
}],
@@ -83,6 +96,9 @@ module.exports = {
copyright: '2019 Walter博客',
count: 60
}],
['@vuepress/search', {
searchMaxSuggestions: 10
}],
['vuepress-plugin-zooming', {
// selector for images that you want to be zoomable
// default: '.content img'
@@ -0,0 +1,21 @@
export default ({ Vue, isServer }) => {
if (!isServer) {
import('vue-toasted' /* webpackChunkName: "notification" */).then((module) => {
Vue.use(module.default)
})
}
// Baidu autopsh integration
if (process.env.NODE_ENV === "production" && typeof window !== "undefined") {
(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);
})();
}
}
@@ -16,10 +16,13 @@ module.exports ={
]
},
{
title: '精选博客',
title: '精选资源',
collapsable: false,
children: [
['http://www.ruanyifeng.com/blog/','阮一峰博客']
['http://www.ruanyifeng.com/blog/','阮一峰博客'],
['https://github.com/vuejs/awesome-vue','awesome vue'],
['https://github.com/vueComponent/ant-design-vue-awesome','awesome ant-design-vue'],
['https://github.com/ulivz/awesome-vuepress','awesome-vuepress']
]
}
]

0 comments on commit 6a8a203

Please sign in to comment.
You can’t perform that action at this time.