@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.cjs CHANGED
@@ -1126,7 +1126,7 @@ ${generated}
1126
1126
 
1127
1127
  ${generated}`;
1128
1128
  }
1129
- function withPostDecorations(source, page, pages, options) {
1129
+ function withPostDecorations(source, page, pages, options, frontmatter) {
1130
1130
  if (!isPost(page)) return source;
1131
1131
  const context = createRenderContext(options, import_node_path6.default.dirname(page.absolutePath));
1132
1132
  const drafts = options.drafts ?? false;
@@ -1145,6 +1145,10 @@ function withPostDecorations(source, page, pages, options) {
1145
1145
 
1146
1146
  ${renderPostNav(page, posts, blog, context)}
1147
1147
  `;
1148
+ if (frontmatter) {
1149
+ frontmatter.prev ??= false;
1150
+ frontmatter.next ??= false;
1151
+ }
1148
1152
  }
1149
1153
  }
1150
1154
  return result;
@@ -1178,7 +1182,7 @@ function applyBlog({ src, env }, options) {
1178
1182
  }
1179
1183
  const page = pages.find((candidate) => candidate.relativePath === relativePath);
1180
1184
  if (!page) return result;
1181
- return page.index ? withPostList(result, page, pages, options) : withPostDecorations(result, page, pages, options);
1185
+ return page.index ? withPostList(result, page, pages, options) : withPostDecorations(result, page, pages, options, frontmatter);
1182
1186
  }
1183
1187
  function blogMarkdown(md, options = {}) {
1184
1188
  md.core.ruler.before("normalize", "vitepress_blog", (state) => {