我无法获取vuepress实例来加载博客。
关于此插件的文档很少: https://vuepress.vuejs.org/plugin/official/plugin-blog.html#usage
这是一个非常简单的插件: https://github.com/vuejs/vuepress/tree/master/packages/%40vuepress/plugin-blog
我找不到任何使用它的人的好例子。
我已将其安装并在config.js中配置为插件,但无法在浏览器中加载帖子。
// .vuepress/config.js
module.exports = {
base: process.env.BASE_URL || '/',
title: 'Docs',
head: [
[
'link',
{
href:
'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons',
rel: 'stylesheet'
}
]
],
plugins: [
'@vuepress/last-updated',
'@vuepress/active-header-links',
'@vuepress/medium-zoom',
'@vuepress/back-to-top',
'@vuepress/blog',
[
'@vuepress/search',
{
searchMaxSuggestions: 10
}
]
],
themeConfig: {
nav: [
{ text: 'Getting Started', link: '/getting-started.html' },
{ text: 'Service Setup', link: '/service-configuration.html' },
{ text: 'Common Solutions', link: '/common-solutions.html' },
],
sidebar: [
'/',
'/getting-started',
'/hello-world',
'/setup-tool',
'/service-configuration',
'/common-solutions',
]
}
};
// package.json
{
"name": "docs",
"version": "1.0.0",
"description": "documentation",
"main": "index.js",
"scripts": {
"dev": "vuepress dev",
"build": "vuepress build"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@vuepress/plugin-active-header-links": "^1.0.0-alpha.0",
"@vuepress/plugin-back-to-top": "^1.0.0-alpha.0",
"@vuepress/plugin-blog": "^1.0.0-alpha.0",
"@vuepress/plugin-medium-zoom": "^1.0.0-alpha.0",
"@vuepress/plugin-search": "^1.0.0-alpha.0",
"vuepress": "^1.0.0-alpha.36"
},
"dependencies": {
"vuetify": "^1.5.2"
}
}