Skip to content

Commit 46fc242

Browse files
committed
docs(blog): explain newer/older links replace VitePress prev/next
- docs: describe that post nav replaces VitePress's previous/next links, how `prev`/`next` and `postNav: false` change that, and the unlisted-post exception
1 parent 886bdf5 commit 46fc242

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

‎docs/plugins/blog/index.md‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ title: Blog
1616
- **[The Scopes Demo](/plugins/blog/demo/)** is a small main blog with a [section blog](/plugins/blog/demo/team/) inside it, and example posts that show which blog lists which post. It is limited to its own folder, so the examples stay off the real blog.
1717
- **[The Browse Demo](/plugins/blog/browse/)** is a section blog of example posts in three categories over two years, for trying the browse panel: filter by category, keyword, year and month, combine them, and open a long row with "+N more".
1818

19-
Open any post to see its byline under the title, and links to the newer and older posts at the end.
19+
Open any post to see its byline under the title, and links to the newer and older posts in its blog at the end, in place of VitePress's previous / next links.
2020

2121
## Why this plugin
2222

@@ -141,7 +141,7 @@ blog:
141141
| `draft` | `false` | Left out of lists and feeds. To leave drafts out of the build and the menus too, see [Drafts](#drafts). |
142142
| `byline` | the `byline` option | `false` hides this post's byline. |
143143
| `cover` | the `cover` option | `true` shows this post's image under its byline. |
144-
| `postNav` | the `postNav` option | `false` hides this post's newer / older links. |
144+
| `postNav` | the `postNav` option | `false` hides this post's newer / older links, and VitePress's previous / next links come back. See [Newer and older links](#newer-and-older-links). |
145145

146146
Title, description, date, author, image and tags can also be written at the top level of the frontmatter, as other blog tools expect. A value under `blog` wins.
147147

@@ -373,7 +373,16 @@ docs/
373373
notes.md blog: true no section blog covers it
374374
```
375375

376-
A post's newer and older links stay within its own blog: the deepest section blog that lists it, otherwise the main blog.
376+
### Newer and older links
377+
378+
A post's newer and older links stay within its own blog: the deepest section blog that lists it, otherwise the main blog. They are in date order, the order readers see on the blog page.
379+
380+
They take the place of VitePress's previous / next links at the foot of the page, which follow the sidebar instead, so a post has one set of links, not two that disagree. To change that for one post:
381+
382+
- **`prev` or `next` in its frontmatter** still sets VitePress's link, as on any page, and it shows beside the newer / older links.
383+
- **`postNav: false`** hides the newer / older links, and VitePress's previous / next come back.
384+
385+
A post that no blog lists keeps VitePress's links, since it has no blog to link within.
377386

378387
### When a section blog helps
379388

@@ -411,7 +420,7 @@ A post image given as a relative path is also copied to `blog-images/` under a n
411420
| `wordsPerMinute` | `200` | For "5 min read". `0` hides reading time. |
412421
| `byline` | `true` | Author, date and tags under each post's title. |
413422
| `cover` | `false` | Each post's image under its byline. |
414-
| `postNav` | `true` | Newer and older post links at the end of each post. |
423+
| `postNav` | `true` | Newer and older post links at the end of each post, in place of VitePress's previous / next links. |
415424
| `drafts` | `false` | List drafts, marked. This site passes `process.env.NODE_ENV !== 'production'`: dev only. |
416425
| `stripTags` | `true` | Remove [Markdown Tags](/plugins/markdown-tags/) syntax from titles and summaries. |
417426
| `feedLimit` | `20` | Most posts in each feed. |

0 commit comments

Comments
 (0)