Skip to content

Commit 66ede10

Browse files
committed
docs: update
1 parent f420359 commit 66ede10

File tree

5 files changed

+40
-31
lines changed

5 files changed

+40
-31
lines changed

packages/docs/docs/miscellaneous/glossary.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,27 @@ sidebar: auto
66

77
You may encounter some unfamiliar concepts in the documentation. This section lists the common terms in the documentation for easy access, learning and plugin/theme development.
88

9-
## frontmatter
9+
## layout
1010

11-
> Access: `$page.frontmatter`
11+
- Access: `$page.frontmatter.layout`
1212

13-
Configuration wrapped by `---` in the `markdown` file of the current page, which is generally used to do some page-level configuration.
13+
Name of the layout component used by the current page.
1414

15-
::: tip
16-
Features such as VuePress's dynamic layout system are based on `frontmatter`. You can use the plugin API [extendPageData](../plugin/option-api.md#extendpagedata) to dynamically modify the value of frontmatter during build time.
17-
:::
15+
## frontmatter
16+
17+
- Access: `$page.frontmatter`
18+
19+
Configuration wrapped by `---` in the `markdown` file of the current page, which is generally used to do some page-level configuration. For more details, please see [Front Matter](../guide/frontmatter.md).
1820

1921
## permalink
2022

21-
> Access: `$page.frontmatter.permalink`
23+
- Access: `$page.frontmatter.permalink`
2224

23-
For permalinks, see [permalinks](../guide/permalinks.md) for more.
25+
Permalinks. For more details, please head [permalinks](../guide/permalinks.md).
2426

2527
## regularPath
2628

27-
> Access: `$page.regularPath`
29+
- Access: `$page.regularPath`
2830

2931
The current page is based on the URL generated by the directory structure.
3032

@@ -34,36 +36,43 @@ When dynamically generating routes during the build period, a page's URL (`$page
3436

3537
## headers
3638

37-
> Access: `$page.headers`
39+
- Access: `$page.headers`
3840

3941
That is, those titles defined by one or more `#` in `markdown`.
4042

4143
## siteConfig
4244

43-
> Access: `$site | Context.siteConfig`
45+
- Access: `$site | Context.siteConfig`
4446

4547
`.vuepress/config.js`, i.e., `site configuration`
4648

4749
## themeConfig
4850

49-
> Access: `$site | Context.themeConfig`
51+
- Access: `$site | Context.themeConfig`
5052

5153
Value of `themeConfig` in `.vuepress/config.js`, i.e., `user's theme configuration`.
5254

5355
## themePath
5456

55-
> Access: `Context.themeAPI.theme.path`
57+
- Access: `Context.themeAPI.theme.path`
5658

5759
Root path (absolute path) of the currently used theme.
5860

5961
## themeEntry
6062

61-
> Access: `Context.themeAPI.theme.entry`
63+
- Access: `Context.themeAPI.theme.entry`
6264

63-
Theme's configuration file (`themePath/index.js`).
65+
Theme's configuration file - `themePath/index.js`.
6466

65-
## layout
67+
## parentThemePath
6668

67-
> Access: `$page.frontmatter.layout`
69+
- Access: `Context.themeAPI.parentTheme.path`
70+
71+
If the current theme is a derived theme, `parentThemePath` refers to the absolute path of the parent theme.
72+
73+
## parentThemeNetry
74+
75+
- Access: `Context.themeAPI.parentTheme.entry`
76+
77+
If the current theme is a derived theme, `parentThemePath` refers to the theme configuration of the parent theme.
6878

69-
Name of the layout component used by the current page.

packages/docs/docs/theme/inheritance.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
We have two main reasons to support this feature:
66

7-
1. VuePress provides users with a [default theme](./default-theme-config.md), which meets the needs of document writers in most scenarios, even so, there are still many users who choose to `eject` and modify, even if they may only need to make minor changes to one of the components.
7+
1. VuePress provides users with a [default theme](./default-theme-config.md), which meets the needs of document writers in most scenarios, even so, there are still many users who choose to `eject` and modify it, even if they may only need to make minor changes to one of the components.
88

99
2. In [0.x](https://vuepress.vuejs.org/guide/custom-themes.html#site-and-page-metadata), only one `Layout.vue` is needed for a theme, so we can achieve simple expansion by directly wrapping `Layout.vue` of another theme.
1010

@@ -17,15 +17,15 @@ Therefore, we need to provide a reasonable and reliable theme inheritance strate
1717
To introduce this section, let's start with a few basic concepts:
1818

1919
- **Atomic theme**:i.e. the parent theme, which is implemented entirely from scratch, like the default theme.
20-
- **Derived theme**:i.e. the child theme, created based on parent theme;
20+
- **Derived theme**:i.e. the child theme, which is created based on parent theme.
2121

2222
::: tip
23-
For now theme inheritance doesn't support high-level inheritance, that means, a derived topic cannot be inherited.
23+
For now theme inheritance doesn't support high-order inheritance, that means, a derived theme cannot be inherited.
2424
:::
2525

2626
## Usage
2727

28-
Suppose you want to create a theme inherited from the default theme of VuePress, you just need to configure the [extend](./option-api.md#extend) option in your theme configuration:
28+
Suppose you want to create a theme inherited from the default theme, you just need to configure the [extend](./option-api.md#extend) option in your theme configuration:
2929

3030
```js
3131
module.exports = {
@@ -35,9 +35,9 @@ module.exports = {
3535

3636
## Inheritance Strategy
3737

38-
**All the capabilities of the parent theme will be `"passed"` to the child theme. For file-level conventions, child theme can override it by creating a file with the same name in the same location. For some theme configuration options, such as [globalLayout](./option-api.md/globallayout), child theme can override it by the same name configuration.**
38+
All the capabilities of the parent theme will be `"passed"` to the child theme. For file-level conventions, child theme can override it by creating a file with the same name in the same location. For some theme configuration options, such as [globalLayout](./option-api.md/globallayout), child theme can override it by the same name configuration.
3939

40-
The [file-level agreement](./writing-a-theme.md#directory-structure) at are as follows:
40+
The [file-level conventions](./writing-a-theme.md#directory-structure) are as follows:
4141

4242
- **Global Components**,i.e. the Vue components under `theme/global-components`.
4343
- **Components**,i.e. the Vue components under `theme/components`.
@@ -148,12 +148,12 @@ In this way, you can easily "tamper" with some part of an atomic theme.
148148

149149
::: tip
150150
1. You'd better override the component based on the code of the corresponding component in the parent theme.
151-
2. Currently, when developing theme locally, you need to manually restart dev serverwhen a component is created or removed.
151+
2. Currently, when developing theme locally, you need to manually restart dev server when a component is created or removed.
152152
:::
153153

154154
## Access Parent Theme
155155

156-
You can use `@parent-theme` to access the root path of the parent theme. The following example shows creating a layout component with the same name in a child theme and simply using slots in the parent theme. [@vuepress/theme-vue](https://github.com/vuejs/vuepress/tree/master/packages/%40vuepress/theme-vue) is created in this way based on the default theme.
156+
You can use `@parent-theme` to access the root path of the parent theme. The following example shows creating a layout component with the same name in a child theme and simply using slots in the parent theme. [@vuepress/theme-vue](https://github.com/vuejs/vuepress/tree/master/packages/%40vuepress/theme-vue) is created in this way.
157157

158158
```vue
159159
<!-- themePath/components/Foo.vue -->

packages/docs/docs/theme/option-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ VuePress provides the ability to inherit one theme from another. VuePress will f
7878
**Also see:**
7979

8080
- [Theme Inheritance](./inheritance.md)
81-
- [VuePress 1.x 的设计理念](../miscellaneous/design-concepts.md)
81+
- [Design Concepts of VuePress 1.x](../miscellaneous/design-concepts.md)
8282

8383
## globalLayout <Badge text="Danger Zone"/>
8484

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ sidebar: auto
5858

5959
- Access: `Context.themeAPI.theme.path`
6060

61-
当前使用的主题的所在路径(绝对路径)
61+
当前使用的主题的所在的绝对路径
6262

6363
## themeEntry
6464

@@ -70,7 +70,7 @@ sidebar: auto
7070

7171
- Access: `Context.themeAPI.parentTheme.path`
7272

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

7575
## parentThemeNetry
7676

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = {
3434

3535
## 继承策略
3636

37-
**父主题的所有能力都会"传递"给子主题,对于文件级别的约定,子主题可以通过在同样的位置创建同名文件来覆盖它;对于某些主题配置选项,如 [globalLayout](./option-api.md#globallayout),子主题也可以通过同名配置来覆盖它。**
37+
父主题的所有能力都会"传递"给子主题,对于文件级别的约定,子主题可以通过在同样的位置创建同名文件来覆盖它;对于某些主题配置选项,如 [globalLayout](./option-api.md#globallayout),子主题也可以通过同名配置来覆盖它。
3838

3939
[文件级别的约定](./writing-a-theme.md#目录结构)如下:
4040

@@ -152,7 +152,7 @@ theme
152152

153153
## 访问父主题
154154

155-
你可以使用 `@parent-theme` 来访问父主题的根路径,下述示例展示了在子主题中创建一个同名的布局组件,并简单使用父主题中的 slot,[@vuepress/theme-vue](https://github.com/vuejs/vuepress/tree/master/packages/%40vuepress/theme-vue) 便是通过这种方式来基于默认主题创造的
155+
你可以使用 `@parent-theme` 来访问父主题的根路径,下述示例展示了在子主题中创建一个同名的布局组件,并简单使用父主题中的 slot,[@vuepress/theme-vue](https://github.com/vuejs/vuepress/tree/master/packages/%40vuepress/theme-vue) 便是通过这种方式创造的
156156

157157
```vue
158158
<!-- themePath/components/Foo.vue -->

0 commit comments

Comments
 (0)