Skip to content

Commit 003f4e8

Browse files
committed
docs: refine docs of prev and next links
1 parent 7bc5825 commit 003f4e8

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

Diff for: packages/docs/docs/theme/default-theme-config.md

+17-5
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,23 @@ Note that it’s `off` by default. If given a `string`, it will be displayed as
418418

419419
## Prev / Next Links
420420

421-
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`:
421+
Prev and next links are automatically inferred based on the sidebar order of the active page.
422+
423+
You can disable them globally with `themeConfig.nextLinks` and `themeConfig.prevLinks`:
424+
425+
``` js
426+
// .vuepress/config.js
427+
module.exports = {
428+
themeConfig: {
429+
// default value is true. Set it to false to hide next page links on all pages
430+
nextLinks: false,
431+
// default value is true. Set it to false to hide prev page links on all pages
432+
prevLinks: false
433+
}
434+
}
435+
```
436+
437+
You can also explicitly overwrite or disable them for individual pages with `YAML front matter`:
422438

423439
``` yaml
424440
---
@@ -451,10 +467,6 @@ module.exports = {
451467
docsBranch: 'master',
452468
// defaults to false, set to true to enable
453469
editLinks: true,
454-
// default value is true. Allows to hide next page links on all pages
455-
nextLinks: false,
456-
// default value is true. Allows to hide prev page links on all pages
457-
prevLinks: false,
458470
// custom text for edit link. Defaults to "Edit this page"
459471
editLinkText: 'Help us improve this page!'
460472
}

Diff for: packages/docs/docs/zh/theme/default-theme-config.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,23 @@ module.exports = {
402402

403403
## 上 / 下一篇链接
404404

405-
上一篇和下一篇文章的链接将会自动地根据当前页面的侧边栏的顺序来获取。你也可以使用 `YAML front matter` 来明确地重写或者禁用它:
405+
上一篇和下一篇文章的链接将会自动地根据当前页面的侧边栏的顺序来获取。
406+
407+
你可以通过 `themeConfig.nextLinks``themeConfig.prevLinks` 来全局禁用它们:
408+
409+
``` js
410+
// .vuepress/config.js
411+
module.exports = {
412+
themeConfig: {
413+
// 默认值是 true 。设置为 false 来禁用所有页面的 下一篇 链接
414+
nextLinks: false,
415+
// 默认值是 true 。设置为 false 来禁用所有页面的 上一篇 链接
416+
prevLinks: false
417+
}
418+
}
419+
```
420+
421+
你也可以使用 `YAML front matter` 来明确地重写或者禁用它们:
406422

407423
``` yaml
408424
---

0 commit comments

Comments
 (0)