@binarynoir/vitepress-blog 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -159,7 +159,7 @@ blog:
159
159
  | `draft` | `false` | Left out of lists and feeds. The page itself is still built: to leave drafts out of the build, the sidebar and the navbar too, see [Drafts](#drafts). |
160
160
  | `byline` | the `byline` option | `false` hides this post's byline. |
161
161
  | `cover` | the `cover` option | `true` shows this post's image under its byline. |
162
- | `postNav` | the `postNav` option | `false` hides this post's newer / older links. |
162
+ | `postNav` | the `postNav` option | `false` hides this post's newer / older links, and VitePress's previous / next links come back. |
163
163
 
164
164
  Title, description, date, author(s), image and tags may also be written at the
165
165
  top level of the frontmatter, as other blog tools expect. A value under `blog`
@@ -525,7 +525,7 @@ link that copy. Public paths (`/cover.png`) and URLs are linked as they are.
525
525
  | `wordsPerMinute` | `200` | For "5 min read". `0` hides reading time. |
526
526
  | `byline` | `true` | Author, date and tags under each post's title. |
527
527
  | `cover` | `false` | Each post's image under its byline. |
528
- | `postNav` | `true` | Newer and older post links at the end of each post. |
528
+ | `postNav` | `true` | Newer and older post links at the end of each post, in place of VitePress's previous / next links. |
529
529
  | `drafts` | `false` | List drafts, marked. Pass `process.env.NODE_ENV !== 'production'` for dev only. |
530
530
  | `stripTags` | `true` | Remove [Markdown Tags](https://binarynoir.tech/plugins/markdown-tags/) syntax from titles and summaries. |
531
531
  | `feedLimit` | `20` | Most posts in each feed. |
@@ -1172,7 +1172,7 @@ ${generated}
1172
1172
 
1173
1173
  ${generated}`;
1174
1174
  }
1175
- function withPostDecorations(source, page, pages, options) {
1175
+ function withPostDecorations(source, page, pages, options, frontmatter) {
1176
1176
  if (!isPost(page)) return source;
1177
1177
  const context = createRenderContext(options, path6.dirname(page.absolutePath));
1178
1178
  const drafts = options.drafts ?? false;
@@ -1191,6 +1191,10 @@ function withPostDecorations(source, page, pages, options) {
1191
1191
 
1192
1192
  ${renderPostNav(page, posts, blog, context)}
1193
1193
  `;
1194
+ if (frontmatter) {
1195
+ frontmatter.prev ??= false;
1196
+ frontmatter.next ??= false;
1197
+ }
1194
1198
  }
1195
1199
  }
1196
1200
  return result;
@@ -1224,7 +1228,7 @@ function applyBlog({ src, env }, options) {
1224
1228
  }
1225
1229
  const page = pages.find((candidate) => candidate.relativePath === relativePath);
1226
1230
  if (!page) return result;
1227
- return page.index ? withPostList(result, page, pages, options) : withPostDecorations(result, page, pages, options);
1231
+ return page.index ? withPostList(result, page, pages, options) : withPostDecorations(result, page, pages, options, frontmatter);
1228
1232
  }
1229
1233
  function blogMarkdown(md, options = {}) {
1230
1234
  md.core.ruler.before("normalize", "vitepress_blog", (state) => {
@@ -1255,4 +1259,4 @@ export {
1255
1259
  hasWidget,
1256
1260
  blogMarkdown
1257
1261
  };
1258
- //# sourceMappingURL=chunk-FPFH7ORO.js.map
1262
+ //# sourceMappingURL=chunk-3K7BQZCI.js.map