Skip to content

Commit

Permalink
docs: refine docs of prev and next links
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Dec 10, 2019
1 parent 7bc5825 commit 003f4e8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
22 changes: 17 additions & 5 deletions packages/docs/docs/theme/default-theme-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,23 @@ Note that it’s `off` by default. If given a `string`, it will be displayed as

## Prev / Next Links

Prev and next links are automatically inferred based on the sidebar order of the active page. You can also explicitly overwrite or disable them globally with [theme config](/theme/default-theme-config.html#git-repository-and-edit-links) or on specific pages using `YAML front matter`:
Prev and next links are automatically inferred based on the sidebar order of the active page.

You can disable them globally with `themeConfig.nextLinks` and `themeConfig.prevLinks`:

``` js
// .vuepress/config.js
module.exports = {
themeConfig: {
// default value is true. Set it to false to hide next page links on all pages
nextLinks: false,
// default value is true. Set it to false to hide prev page links on all pages
prevLinks: false
}
}
```

You can also explicitly overwrite or disable them for individual pages with `YAML front matter`:

``` yaml
---
Expand Down Expand Up @@ -451,10 +467,6 @@ module.exports = {
docsBranch: 'master',
// defaults to false, set to true to enable
editLinks: true,
// default value is true. Allows to hide next page links on all pages
nextLinks: false,
// default value is true. Allows to hide prev page links on all pages
prevLinks: false,
// custom text for edit link. Defaults to "Edit this page"
editLinkText: 'Help us improve this page!'
}
Expand Down
18 changes: 17 additions & 1 deletion packages/docs/docs/zh/theme/default-theme-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,23 @@ module.exports = {

## 上 / 下一篇链接

上一篇和下一篇文章的链接将会自动地根据当前页面的侧边栏的顺序来获取。你也可以使用 `YAML front matter` 来明确地重写或者禁用它:
上一篇和下一篇文章的链接将会自动地根据当前页面的侧边栏的顺序来获取。

你可以通过 `themeConfig.nextLinks``themeConfig.prevLinks` 来全局禁用它们:

``` js
// .vuepress/config.js
module.exports = {
themeConfig: {
// 默认值是 true 。设置为 false 来禁用所有页面的 下一篇 链接
nextLinks: false,
// 默认值是 true 。设置为 false 来禁用所有页面的 上一篇 链接
prevLinks: false
}
}
```

你也可以使用 `YAML front matter` 来明确地重写或者禁用它们:

``` yaml
---
Expand Down

0 comments on commit 003f4e8

Please sign in to comment.