Skip to content

Commit 77ef9ae

Browse files
committed
docs: tweaks
1 parent a33a1a8 commit 77ef9ae

File tree

2 files changed

+43
-43
lines changed

2 files changed

+43
-43
lines changed

Diff for: packages/docs/docs/plugin/README.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ module.exports = {
518518
key, // page's unique hash key
519519
frontmatter, // page's frontmatter object
520520
regularPath, // current page's default link (follow the file hierarchy)
521-
path, // current page's permalink
521+
path, // current page's real link (use regularPath when permalink does not exist)
522522
} = $page
523523

524524
// 1. Add extra fields.
@@ -530,11 +530,11 @@ module.exports = {
530530
}
531531
```
532532

533-
::: warning 注意
534-
那些以 `_` 开头的字段意味着你只能在编译期访问。
533+
::: warning Note
534+
These fields starting with an `_` means you can only access them during build time.
535535
:::
536536

537-
例子:
537+
e.g.
538538

539539
``` js
540540
module.exports = {
@@ -544,17 +544,17 @@ module.exports = {
544544
}
545545
```
546546

547-
然后你可以在任意的 Vue 中通过 `this.$page.size` 来访问这个变量。
547+
Then you can use this value via `this.$page.size` in any Vue component.
548548

549549
### clientRootMixin
550550

551-
- 类型: `String`
552-
- 默认值: `undefined`
551+
- Type: `String`
552+
- Default: `undefined`
553553

554-
指向 `mixin` 文件的路径,它让你你可以控制根组件的生命周期:
554+
A path to the mixin file which allow you to control the life cycle of root component.
555555

556556
``` js
557-
// 插件的入口
557+
// plugin's entry
558558
const path = require('path')
559559

560560
module.exports = {
@@ -572,10 +572,10 @@ export default {
572572

573573
### additionalPages
574574

575-
- 类型: `Array|Function`
576-
- 默认值: `undefined`
575+
- Type: `Array|Function`
576+
- Default: `undefined`
577577

578-
增加一个指向某个 markdown 文件的页面:
578+
Add a page pointing to a markdown file:
579579

580580
```js
581581
const path = require('path')
@@ -590,7 +590,7 @@ module.exports = {
590590
}
591591
```
592592

593-
或增加一个具有明确内容的页面:
593+
Add a page with explicit content:
594594

595595
```js
596596
module.exports = {
@@ -610,7 +610,7 @@ module.exports = {
610610
}
611611
```
612612

613-
或增加一个纯粹的路由:
613+
Add a pure route:
614614

615615
```js
616616
module.exports = {
@@ -627,10 +627,10 @@ module.exports = {
627627

628628
### globalUIComponents
629629

630-
- 类型: `Array|String`
631-
- 默认值: `undefined`
630+
- Type: `Array|String`
631+
- Default: `undefined`
632632

633-
你可以想注入某些全局的 UI,并固定在页面中的某处,如 `back-to-top`, `popup`。在 VuePress 中,**一个全局 UI 就是一个 Vue 组件。**你可以直接配置该全局组件的名称,如:
633+
You might want to inject some global UI fixed somewhere on the page, e.g. `back-to-top`, `popup`. In VuePress, **a global UI is a Vue component**, you can directly define the component's name(s) in this option, e.g.
634634

635635
``` js
636636
module.exports = {
@@ -641,7 +641,7 @@ module.exports = {
641641
}
642642
```
643643

644-
VuePress 将会自动将这些组件注入到布局组件的隔壁:
644+
Then, VuePress will automatically inject these components behind the layout component:
645645

646646
```html
647647
<div id="app">

Diff for: packages/docs/docs/zh/plugin/README.md

+25-25
Original file line numberDiff line numberDiff line change
@@ -509,14 +509,14 @@ import { SOURCE_DIR } from '@dynamic/constans'
509509
module.exports = {
510510
extendPageData ($page) {
511511
const {
512-
_filePath, // file's absolute path
513-
_computed, // access the client global computed mixins at build time, e.g _computed.$localePath.
514-
_content, // file's raw content string
515-
_strippedContent, // file's content string without frontmatter
516-
key, // page's unique hash key
517-
frontmatter, // page's frontmatter object
518-
regularPath, // current page's default link (follow the file hierarchy)
519-
path, // current page's permalink
512+
_filePath, // 源文件的绝对路径
513+
_computed, // 在构建期访问全局的计算属性,如:_computed.$localePath.
514+
_content, // 源文件的原始内容字符串
515+
_strippedContent, // 源文件剔除掉 frontmatter 的内容字符串
516+
key, // 页面唯一的 hash key
517+
frontmatter, // 页面的 frontmatter 对象
518+
regularPath, // 当前页面遵循文件层次结构的默认链接
519+
path, // 当前页面的实际链接(在 permalink 不存在时,使用 regularPath )
520520
} = $page
521521

522522
// 1. Add extra fields.
@@ -528,11 +528,11 @@ module.exports = {
528528
}
529529
```
530530

531-
::: warning Note
532-
These fields starting with an `_` means you can only access them during build time.
531+
::: warning 注意
532+
那些以 `_` 开头的字段意味着你只能在编译期访问。
533533
:::
534534

535-
e.g.
535+
例子:
536536

537537
``` js
538538
module.exports = {
@@ -542,17 +542,17 @@ module.exports = {
542542
}
543543
```
544544

545-
Then you can use this value via `this.$page.size` in any Vue component.
545+
然后你可以在任意的 Vue 中通过 `this.$page.size` 来访问这个变量。
546546

547547
### clientRootMixin
548548

549-
- Type: `String`
550-
- Default: `undefined`
549+
- 类型: `String`
550+
- 默认值: `undefined`
551551

552-
A path to the mixin file which allow you to control the life cycle of root component.
552+
指向 `mixin` 文件的路径,它让你你可以控制根组件的生命周期:
553553

554554
``` js
555-
// plugin's entry
555+
// 插件的入口
556556
const path = require('path')
557557

558558
module.exports = {
@@ -570,10 +570,10 @@ export default {
570570

571571
### additionalPages
572572

573-
- Type: `Array|Function`
574-
- Default: `undefined`
573+
- 类型: `Array|Function`
574+
- 默认值: `undefined`
575575

576-
Add a page pointing to a markdown file:
576+
增加一个指向某个 markdown 文件的页面:
577577

578578
```js
579579
const path = require('path')
@@ -588,7 +588,7 @@ module.exports = {
588588
}
589589
```
590590

591-
Add a page with explicit content:
591+
或增加一个具有明确内容的页面:
592592

593593
```js
594594
module.exports = {
@@ -608,7 +608,7 @@ module.exports = {
608608
}
609609
```
610610

611-
Add a pure route:
611+
或增加一个纯粹的路由:
612612

613613
```js
614614
module.exports = {
@@ -625,10 +625,10 @@ module.exports = {
625625

626626
### globalUIComponents
627627

628-
- Type: `Array|String`
629-
- Default: `undefined`
628+
- 类型: `Array|String`
629+
- 默认值: `undefined`
630630

631-
You might want to inject some global UI fixed somewhere on the page, e.g. `back-to-top`, `popup`. In VuePress, **a global UI is a Vue component**, you can directly define the component's name(s) in this option, e.g.
631+
你可以想注入某些全局的 UI,并固定在页面中的某处,如 `back-to-top`, `popup`。在 VuePress 中,**一个全局 UI 就是一个 Vue 组件。**你可以直接配置该全局组件的名称,如:
632632

633633
``` js
634634
module.exports = {
@@ -639,7 +639,7 @@ module.exports = {
639639
}
640640
```
641641

642-
Then, VuePress will automatically inject these components behind the layout component:
642+
VuePress 将会自动将这些组件注入到布局组件的隔壁:
643643

644644
```html
645645
<div id="app">

0 commit comments

Comments
 (0)