diff --git a/packages/@vuepress/core/lib/plugin-api/util.js b/packages/@vuepress/core/lib/plugin-api/util.js index 706da428a5..4e27c6e1f9 100644 --- a/packages/@vuepress/core/lib/plugin-api/util.js +++ b/packages/@vuepress/core/lib/plugin-api/util.js @@ -86,5 +86,6 @@ exports.normalizePluginsConfig = function (pluginsConfig) { return [item, pluginsConfig[item]] }) } + console.log(pluginsConfig) return pluginsConfig } diff --git a/packages/@vuepress/core/lib/theme-api/index.js b/packages/@vuepress/core/lib/theme-api/index.js index 76c760b083..d6a38cd7e7 100644 --- a/packages/@vuepress/core/lib/theme-api/index.js +++ b/packages/@vuepress/core/lib/theme-api/index.js @@ -22,6 +22,7 @@ module.exports = class ThemeAPI { init () { const alias = { + '@theme': this.theme.path, '@current-theme': this.theme.path } if (this.existsParentTheme) { diff --git a/packages/docs/docs/.vuepress/config.js b/packages/docs/docs/.vuepress/config.js index 7cca055dd5..66fa35237d 100755 --- a/packages/docs/docs/.vuepress/config.js +++ b/packages/docs/docs/.vuepress/config.js @@ -74,6 +74,7 @@ module.exports = ctx => ({ ['@vuepress/google-analytics', { ga: 'UA-128189152-1' }], + 'flowchart' ], extendMarkdown (md) { md.use(container, 'upgrade', { diff --git a/packages/docs/docs/miscellaneous/glossary.md b/packages/docs/docs/miscellaneous/glossary.md index 55e19b048c..86baf096df 100755 --- a/packages/docs/docs/miscellaneous/glossary.md +++ b/packages/docs/docs/miscellaneous/glossary.md @@ -48,9 +48,9 @@ That is, those titles defined by one or more `#` in `markdown`. ## themeConfig -- Access: `$site | Context.themeConfig` +- Access: `$themeConfig | Context.themeConfig` -Value of `themeConfig` in `.vuepress/config.js`, i.e., `user's theme configuration`. +Value of `themeConfig` in `.vuepress/config.js`, i.e., user's theme configuration. ## themePath @@ -70,7 +70,7 @@ Theme's configuration file - `themePath/index.js`. If the current theme is a derived theme, `parentThemePath` refers to the absolute path of the parent theme. -## parentThemeNetry +## parentThemeEntry - Access: `Context.themeAPI.parentTheme.entry` diff --git a/packages/docs/docs/theme/inheritance.md b/packages/docs/docs/theme/inheritance.md index ec346148fe..58f7603f68 100755 --- a/packages/docs/docs/theme/inheritance.md +++ b/packages/docs/docs/theme/inheritance.md @@ -138,7 +138,7 @@ On this premise, when you create a `Navbar` component in the same place in the c ::: vue theme -└── components +└── components    └── `Navbar.vue` ::: diff --git a/packages/docs/docs/zh/miscellaneous/design-concepts.md b/packages/docs/docs/zh/miscellaneous/design-concepts.md index 4261f596f2..a4ad3bdc7f 100644 --- a/packages/docs/docs/zh/miscellaneous/design-concepts.md +++ b/packages/docs/docs/zh/miscellaneous/design-concepts.md @@ -92,17 +92,27 @@ VuePress 1.0 开始引入一些约定,以减少用户过多的配置压力。 `templates/*` 遵循一定的加载优先级,以 `templates/ssr.html` 为例: @flowstart -cond1=>condition: 用户的 ssr.html +cond1=>condition: siteConfig.ssrTemplate 是否存在? -cond2=>condition: 主题的 ssr.html +cond2=>condition: 用户的 templates/ssr.html 是否存在? +cond3=>condition: themeEntry.ssrTemplate +是否存在? +cond4=>condition: 主题的 templates/ssr.html +是否存在? + stage1=>operation: 使用用户的 ssr.html -stage2=>operation: 使用主题的 ssr.html -stage3=>operation: 使用默认的 ssr.html +stage2=>operation: 使用 siteConfig.ssrTemplate +stage3=>operation: 使用主题的 ssr.html +stage4=>operation: 使用 themeEntry.ssrTemplate +stage5=>operation: Using default ssr.html + +cond1(no, bottom)->cond2(no, bottom)->cond3(no, bottom)->cond4(no, bottom)->stage5 +cond1(yes)->stage1 +cond2(yes)->stage2 +cond3(yes)->stage3 +cond4(yes)->stage4 -cond1(no, right)->cond2(no)->stage3 -cond1(yes, bottom)->stage1 -cond2(yes, bottom)->stage2 @flowend ::: warning 注意 diff --git a/packages/docs/docs/zh/miscellaneous/glossary.md b/packages/docs/docs/zh/miscellaneous/glossary.md index 2c2701445a..fa60adaf73 100755 --- a/packages/docs/docs/zh/miscellaneous/glossary.md +++ b/packages/docs/docs/zh/miscellaneous/glossary.md @@ -50,7 +50,7 @@ sidebar: auto ## themeConfig -- Access: `$site | Context.themeConfig` +- Access: `$themeConfig | Context.themeConfig` 即 `.vuepress/config.js` 中 `themeConfig` 的值,是用户对当前所使用的主题的配置。 @@ -72,7 +72,7 @@ sidebar: auto 如果当前使用的主题是一个派生主题,那么 `parentThemePath` 就是指父主题的所在绝对路径。 -## parentThemeNetry +## parentThemeEntry - Access: `Context.themeAPI.parentTheme.entry` diff --git a/packages/docs/docs/zh/theme/inheritance.md b/packages/docs/docs/zh/theme/inheritance.md index 29ca46300d..cc0816b36b 100755 --- a/packages/docs/docs/zh/theme/inheritance.md +++ b/packages/docs/docs/zh/theme/inheritance.md @@ -137,7 +137,7 @@ import Home from '@theme/components/Navbar.vue' ::: vue theme -└── components +└── components    └── `Navbar.vue` ::: diff --git a/packages/docs/docs/zh/theme/using-a-theme.md b/packages/docs/docs/zh/theme/using-a-theme.md index 2554e7930e..2c4f729db8 100644 --- a/packages/docs/docs/zh/theme/using-a-theme.md +++ b/packages/docs/docs/zh/theme/using-a-theme.md @@ -2,7 +2,7 @@ 使用一个主题和使用一个插件的方式几乎一致。 -## 使用来自依赖的插件 +## 使用来自依赖的主题 一个主题可以在以 `vuepress-theme-xxx` 的形式发布到 npm,你可以这样使用它: