@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/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  POST_FRONTMATTER_KEY,
6
6
  WIDGET_NAME,
7
7
  blogMarkdown
8
- } from "./chunk-FPFH7ORO.js";
8
+ } from "./chunk-3K7BQZCI.js";
9
9
  import "./chunk-42Z6H7IN.js";
10
10
  export {
11
11
  BLOG_POSTS_PLACEHOLDER,
@@ -1272,7 +1272,7 @@ ${generated}
1272
1272
 
1273
1273
  ${generated}`;
1274
1274
  }
1275
- function withPostDecorations(source, page, pages, options) {
1275
+ function withPostDecorations(source, page, pages, options, frontmatter) {
1276
1276
  if (!isPost(page)) return source;
1277
1277
  const context = createRenderContext(options, import_node_path6.default.dirname(page.absolutePath));
1278
1278
  const drafts = options.drafts ?? false;
@@ -1291,6 +1291,10 @@ function withPostDecorations(source, page, pages, options) {
1291
1291
 
1292
1292
  ${renderPostNav(page, posts, blog, context)}
1293
1293
  `;
1294
+ if (frontmatter) {
1295
+ frontmatter.prev ??= false;
1296
+ frontmatter.next ??= false;
1297
+ }
1294
1298
  }
1295
1299
  }
1296
1300
  return result;
@@ -1324,7 +1328,7 @@ function applyBlog({ src, env }, options) {
1324
1328
  }
1325
1329
  const page = pages.find((candidate) => candidate.relativePath === relativePath);
1326
1330
  if (!page) return result;
1327
- return page.index ? withPostList(result, page, pages, options) : withPostDecorations(result, page, pages, options);
1331
+ return page.index ? withPostList(result, page, pages, options) : withPostDecorations(result, page, pages, options, frontmatter);
1328
1332
  }
1329
1333
  function blogMarkdown(md, options = {}) {
1330
1334
  md.core.ruler.before("normalize", "vitepress_blog", (state) => {