vuepress-theme-reco/index.js
reco_luan 1eb7517329 fix: fix style
Fix style

Add @vuepress-reco/vuepress-plugin-extract-code
2019-11-01 19:32:52 +08:00

80 lines
1.8 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/back-to-top',
'@vuepress-reco/extract-code',
'@vuepress-reco/loading-page',
'@vuepress-reco/pagation',
'@vuepress-reco/screenfull',
'@vuepress-reco/ga',
'@vuepress-reco/comments',
'@vuepress/active-header-links',
['@vuepress/medium-zoom', {
selector: '.theme-reco-content :not(a) > img'
}],
'@vuepress/plugin-nprogress',
'@vuepress/search',
['@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'
},
{
id: 'timeline',
keys: ['timeline'],
path: '/timeline/',
layout: 'TimeLines',
scopeLayout: 'TimeLine'
}
]
}],
['container', {
type: 'tip',
defaultTitle: {
'/zh/': '提示'
}
}],
['container', {
type: 'warning',
defaultTitle: {
'/zh/': '注意'
}
}],
['container', {
type: 'danger',
defaultTitle: {
'/zh/': '警告'
}
}]
]
})