从 VuePress 0.x 迁移
站点配置
ga 替换
GA 已经被分离为一个单独的插件 @vuepress/plugin-google-analytics。
Upgrade Path
- 安装
@vuepress/plugin-google-analytics:
yarn add -D @vuepress/plugin-google-analytics@next
# OR npm install -D @vuepress/plugin-google-analytics@next
- 更新
vuepress/config.js:
module.exports = {
- ga: 'UA-12345678-9'
+ plugins: [
+ ['@vuepress/google-analytics', {
+ ga: 'UA-12345678-9'
+ }]
+ ]
}
markdown.config 重命名
使用 extendMarkdown:
Upgrade Path
更新 vuepress/config.js:
// vuepress/config.js
module.exports = {
- markdown: {
- config(md) { /* ... */ }
- },
+ extendMarkdown(md) { /* ... */ }
}
serviceWorker 替换
Service Worker 相关的功能已经被分离为一个单独的插件 @vuepress/plugin-pwa。
Upgrade Path
默认主题配置
.vuepress/override.styl 替换
使用 .vuepress/styles/palette.styl 代替。
Upgrade Path
.vuepress/style.styl 替换
使用 .vuepress/styles/index.styl 代替。