vuepress-theme-reco/index.js
reco_luan c3faf8cd34 refactor: update version of @vuepress/plugin-blog
1. The plugin was refactored after the1.0.0-alpha.49, but the theme was not updated.

2.  In this update, the plug-in version is updated, and the data acquisition method of category and tag is changed accordingly.
2019-10-08 22:14:32 +08:00

66 lines
1.5 KiB
JavaScript

const path = require('path')
// Theme API.
module.exports = (options, ctx) => ({
alias () {
const { themeConfig, siteConfig } = ctx
// resolve algolia
const isAlgoliaSearch = (
themeConfig.algolia ||
Object.keys(siteConfig.locales && themeConfig.locales || {})
.some(base => themeConfig.locales[base].algolia)
)
return {
'@AlgoliaSearchBox': isAlgoliaSearch
? path.resolve(__dirname, 'components/AlgoliaSearchBox.vue')
: path.resolve(__dirname, 'noopModule.js')
}
},
plugins: [
'@vuepress-reco/vuepress-plugin-back-to-top',
'@vuepress-reco/vuepress-plugin-pagation',
'@vuepress-reco/vuepress-plugin-screenfull',
'@vuepress/active-header-links',
['@vuepress/plugin-blog', {
permalink: '/:regular',
frontmatters: [
{
id: 'tags',
keys: ['tags'],
path: '/tag/',
layout: 'Tags',
scopeLayout: 'Tag'
},
{
id: 'categories',
keys: ['categories'],
path: '/categories/',
layout: 'Categories',
scopeLayout: 'Category'
},
],
}],
'@vuepress/search',
'@vuepress/plugin-nprogress',
['container', {
type: 'tip',
defaultTitle: {
'/zh/': '提示'
}
}],
['container', {
type: 'warning',
defaultTitle: {
'/zh/': '注意'
}
}],
['container', {
type: 'danger',
defaultTitle: {
'/zh/': '警告'
}
}]
]
})