-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add documentation for prev-next links (#889)
Co-authored-by: Percy Ma <[email protected]> Co-authored-by: Divyansh Singh <[email protected]>
- Loading branch information
1 parent
e15941f
commit a2b1490
Showing
1 changed file
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,53 @@ | ||
# Prev Next Link | ||
|
||
Documentation coming soon... | ||
Prev or Next Link allows you to add buttons at the end of each page that allow you to go to the previous or next topic. To enable it, add `themeConfig.prev` or `themeConfig.next` to your configuration. | ||
|
||
|
||
## prev | ||
|
||
- Type: `NavLink | string` | ||
|
||
- Details: | ||
|
||
Specify the link of the previous page. | ||
|
||
If you don't set this frontmatter, the link will be inferred from the sidebar config. | ||
|
||
To configure the prev link manually, you can set this frontmatter to a `NavLink` object or a string: | ||
|
||
- A `NavLink` object should have a `text` field and a `link` field. | ||
- A string should be the path to the target page file. It will be converted to a `NavLink` object, whose `text` is the page title, and `link` is the page route path. | ||
|
||
- Example: | ||
|
||
```md | ||
--- | ||
# NavLink | ||
prev: | ||
text: Get Started | ||
link: /guide/getting-started.html | ||
|
||
# NavLink - external url | ||
prev: | ||
text: GitHub | ||
link: https://github.com | ||
|
||
# string - page file path | ||
prev: /guide/getting-started.md | ||
|
||
# string - page file relative path | ||
prev: ../../guide/getting-started.md | ||
--- | ||
``` | ||
|
||
## next | ||
|
||
- Type: `NavLink | string` | ||
|
||
- Details: | ||
|
||
Specify the link of the next page. | ||
|
||
If you don't set this frontmatter, the link will be inferred from the sidebar config. | ||
|
||
The type is the same as [prev](#prev) frontmatter. |