Skip to content

Commit

Permalink
docs: add migration guide for theme data (#687)
Browse files Browse the repository at this point in the history
Co-authored-by: meteorlxy <meteor.lxy@foxmail.com>
  • Loading branch information
ArsalaBangash and meteorlxy committed Feb 24, 2022
1 parent 73d297f commit 7342821
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/guide/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ Some major breaking changes:
- Files in `theme/layouts/` directory will not be registered as layout components automatically. You need to specify it explicitly in `layouts` option.
- Files in `theme/templates/` directory will not be used as dev / ssr template automatically.
- Always provide a theme entry file, and do not use `"main": "layouts/Layout.vue"` as the theme entry.
- `themeConfig` is removed from site data. To access the `themeConfig` as you would via `this.$site.themeConfig` in v1, we now recommend using the [@vuepress/plugin-theme-data](../reference/plugin/theme-data.md) plugin and its `useThemeData` composition API.
- Stylus is no longer the default CSS pre-processor, and the stylus palette system is not embedded. If you still want to use similar palette system as v1, [@vuepress/plugin-palette](../reference/plugin/palette.md) may help.
- Markdown code blocks syntax highlighting by Prism.js is not embedded by default. You can use either [@vuepress/plugin-prismjs](../reference/plugin/prismjs.md) or [@vuepress/plugin-shiki](../reference/plugin/shiki.md), or implement syntax highlighting in your own way.
- For scalability concern, `$site.pages` is not available any more.
- For scalability concerns, `this.$site.pages` is not available any more.
3 changes: 2 additions & 1 deletion docs/zh/guide/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ v1 的主题和插件和 v2 并不兼容。
- `theme/layouts/` 目录下的文件不会被自动注册为布局组件。你需要通过 `layouts` 配置项来显式指定。
- `theme/templates/` 目录下的文件不会被自动作为 dev / ssr 的模板。
- 你始终需要提供主题入口文件,并且不要使用 `"main": "layouts/Layout.vue"` 作为主题入口。
- `themeConfig` 从站点数据中移除。如果你想要像 v1 一样通过 `this.$site.themeConfig` 来访问 `themeConfig` ,我们现在建议使用 [@vuepress/plugin-theme-data](../reference/plugin/theme-data.md) 插件和它提供的 Composition API `useThemeData`
- Stylus 不再是默认的 CSS 预处理器,并且 Stylus 调色板系统不再被默认支持。如果你仍然想要使用和 v1 类似的调色板系统,可以使用 [@vuepress/plugin-palette](../reference/plugin/palette.md)
- 由 Prism.js 提供的 Markdown 代码块的语法高亮不再被默认支持。你可以选择使用 [@vuepress/plugin-prismjs](../reference/plugin/prismjs.md)[@vuepress/plugin-shiki](../reference/plugin/shiki.md) ,或者用你自己的方式实现语法高亮。
- 考虑到可扩展性, `$site.pages` 不再可用。
- 考虑到可扩展性, `this.$site.pages` 不再可用。

0 comments on commit 7342821

Please sign in to comment.