Skip to content

Commit 1df7a7d

Browse files
committed
refactor: address comments
1 parent d49cb25 commit 1df7a7d

File tree

9 files changed

+28
-15
lines changed

9 files changed

+28
-15
lines changed

packages/@vuepress/core/lib/plugin-api/util.js

+1
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,6 @@ exports.normalizePluginsConfig = function (pluginsConfig) {
8686
return [item, pluginsConfig[item]]
8787
})
8888
}
89+
console.log(pluginsConfig)
8990
return pluginsConfig
9091
}

packages/@vuepress/core/lib/theme-api/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = class ThemeAPI {
2222

2323
init () {
2424
const alias = {
25+
'@theme': this.theme.path,
2526
'@current-theme': this.theme.path
2627
}
2728
if (this.existsParentTheme) {

packages/docs/docs/.vuepress/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ module.exports = ctx => ({
7474
['@vuepress/google-analytics', {
7575
ga: 'UA-128189152-1'
7676
}],
77+
'flowchart'
7778
],
7879
extendMarkdown (md) {
7980
md.use(container, 'upgrade', {

packages/docs/docs/miscellaneous/glossary.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ That is, those titles defined by one or more `#` in `markdown`.
4848

4949
## themeConfig
5050

51-
- Access: `$site | Context.themeConfig`
51+
- Access: `$themeConfig | Context.themeConfig`
5252

53-
Value of `themeConfig` in `.vuepress/config.js`, i.e., `user's theme configuration`.
53+
Value of `themeConfig` in `.vuepress/config.js`, i.e., user's theme configuration.
5454

5555
## themePath
5656

@@ -70,7 +70,7 @@ Theme's configuration file - `themePath/index.js`.
7070

7171
If the current theme is a derived theme, `parentThemePath` refers to the absolute path of the parent theme.
7272

73-
## parentThemeNetry
73+
## parentThemeEntry
7474

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

packages/docs/docs/theme/inheritance.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ On this premise, when you create a `Navbar` component in the same place in the c
138138

139139
::: vue
140140
theme
141-
└── components
141+
└── components
142142
   └── `Navbar.vue`
143143
:::
144144

packages/docs/docs/zh/miscellaneous/design-concepts.md

+17-7
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,27 @@ VuePress 1.0 开始引入一些约定,以减少用户过多的配置压力。
9292
`templates/*` 遵循一定的加载优先级,以 `templates/ssr.html` 为例:
9393

9494
@flowstart
95-
cond1=>condition: 用户的 ssr.html
95+
cond1=>condition: siteConfig.ssrTemplate
9696
是否存在?
97-
cond2=>condition: 主题的 ssr.html
97+
cond2=>condition: 用户的 templates/ssr.html
9898
是否存在?
99+
cond3=>condition: themeEntry.ssrTemplate
100+
是否存在?
101+
cond4=>condition: 主题的 templates/ssr.html
102+
是否存在?
103+
99104
stage1=>operation: 使用用户的 ssr.html
100-
stage2=>operation: 使用主题的 ssr.html
101-
stage3=>operation: 使用默认的 ssr.html
105+
stage2=>operation: 使用 siteConfig.ssrTemplate
106+
stage3=>operation: 使用主题的 ssr.html
107+
stage4=>operation: 使用 themeEntry.ssrTemplate
108+
stage5=>operation: Using default ssr.html
109+
110+
cond1(no, bottom)->cond2(no, bottom)->cond3(no, bottom)->cond4(no, bottom)->stage5
111+
cond1(yes)->stage1
112+
cond2(yes)->stage2
113+
cond3(yes)->stage3
114+
cond4(yes)->stage4
102115

103-
cond1(no, right)->cond2(no)->stage3
104-
cond1(yes, bottom)->stage1
105-
cond2(yes, bottom)->stage2
106116
@flowend
107117

108118
::: warning 注意

packages/docs/docs/zh/miscellaneous/glossary.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ sidebar: auto
5050

5151
## themeConfig
5252

53-
- Access: `$site | Context.themeConfig`
53+
- Access: `$themeConfig | Context.themeConfig`
5454

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

@@ -72,7 +72,7 @@ sidebar: auto
7272

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

75-
## parentThemeNetry
75+
## parentThemeEntry
7676

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

packages/docs/docs/zh/theme/inheritance.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ import Home from '@theme/components/Navbar.vue'
137137

138138
::: vue
139139
theme
140-
└── components
140+
└── components
141141
   └── `Navbar.vue`
142142
:::
143143

packages/docs/docs/zh/theme/using-a-theme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
## 使用来自依赖的插件
5+
## 使用来自依赖的主题
66

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

0 commit comments

Comments
 (0)