You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/docs/miscellaneous/glossary.md
+27-18Lines changed: 27 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -6,25 +6,27 @@ sidebar: auto
6
6
7
7
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.
8
8
9
-
## frontmatter
9
+
## layout
10
10
11
-
>Access: `$page.frontmatter`
11
+
- Access: `$page.frontmatter.layout`
12
12
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.
14
14
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).
18
20
19
21
## permalink
20
22
21
-
>Access: `$page.frontmatter.permalink`
23
+
- Access: `$page.frontmatter.permalink`
22
24
23
-
For permalinks, see [permalinks](../guide/permalinks.md) for more.
25
+
Permalinks. For more details, please head [permalinks](../guide/permalinks.md).
24
26
25
27
## regularPath
26
28
27
-
>Access: `$page.regularPath`
29
+
- Access: `$page.regularPath`
28
30
29
31
The current page is based on the URL generated by the directory structure.
30
32
@@ -34,36 +36,43 @@ When dynamically generating routes during the build period, a page's URL (`$page
34
36
35
37
## headers
36
38
37
-
>Access: `$page.headers`
39
+
- Access: `$page.headers`
38
40
39
41
That is, those titles defined by one or more `#` in `markdown`.
Copy file name to clipboardExpand all lines: packages/docs/docs/theme/inheritance.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
We have two main reasons to support this feature:
6
6
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.
8
8
9
9
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.
10
10
@@ -17,15 +17,15 @@ Therefore, we need to provide a reasonable and reliable theme inheritance strate
17
17
To introduce this section, let's start with a few basic concepts:
18
18
19
19
-**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.
21
21
22
22
::: 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.
24
24
:::
25
25
26
26
## Usage
27
27
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:
29
29
30
30
```js
31
31
module.exports= {
@@ -35,9 +35,9 @@ module.exports = {
35
35
36
36
## Inheritance Strategy
37
37
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.
39
39
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:
41
41
42
42
-**Global Components**,i.e. the Vue components under `theme/global-components`.
43
43
-**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.
148
148
149
149
::: tip
150
150
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.
152
152
:::
153
153
154
154
## Access Parent Theme
155
155
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.
0 commit comments