Skip to content

Commit

Permalink
refactor: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Feb 26, 2019
1 parent d49cb25 commit 1df7a7d
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 15 deletions.
1 change: 1 addition & 0 deletions packages/@vuepress/core/lib/plugin-api/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@ exports.normalizePluginsConfig = function (pluginsConfig) {
return [item, pluginsConfig[item]]
})
}
console.log(pluginsConfig)
return pluginsConfig
}
1 change: 1 addition & 0 deletions packages/@vuepress/core/lib/theme-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = class ThemeAPI {

init () {
const alias = {
'@theme': this.theme.path,
'@current-theme': this.theme.path
}
if (this.existsParentTheme) {
Expand Down
1 change: 1 addition & 0 deletions packages/docs/docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module.exports = ctx => ({
['@vuepress/google-analytics', {
ga: 'UA-128189152-1'
}],
'flowchart'
],
extendMarkdown (md) {
md.use(container, 'upgrade', {
Expand Down
6 changes: 3 additions & 3 deletions packages/docs/docs/miscellaneous/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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`

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/theme/inheritance.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
:::

Expand Down
24 changes: 17 additions & 7 deletions packages/docs/docs/zh/miscellaneous/design-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 注意
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/docs/zh/miscellaneous/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ sidebar: auto

## themeConfig

- Access: `$site | Context.themeConfig`
- Access: `$themeConfig | Context.themeConfig`

`.vuepress/config.js``themeConfig` 的值,是用户对当前所使用的主题的配置。

Expand All @@ -72,7 +72,7 @@ sidebar: auto

如果当前使用的主题是一个派生主题,那么 `parentThemePath` 就是指父主题的所在绝对路径。

## parentThemeNetry
## parentThemeEntry

- Access: `Context.themeAPI.parentTheme.entry`

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/zh/theme/inheritance.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ import Home from '@theme/components/Navbar.vue'

::: vue
theme
└── components
└── components
   └── `Navbar.vue`
:::

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/zh/theme/using-a-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

使用一个主题和使用一个插件的方式几乎一致。

## 使用来自依赖的插件
## 使用来自依赖的主题

一个主题可以在以 `vuepress-theme-xxx` 的形式发布到 npm,你可以这样使用它:

Expand Down

0 comments on commit 1df7a7d

Please sign in to comment.