@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 +2 -2
- package/dist/{chunk-FPFH7ORO.js → chunk-3K7BQZCI.js} +7 -3
- package/dist/{chunk-FPFH7ORO.js.map → chunk-3K7BQZCI.js.map} +1 -1
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/vitepress.cjs +6 -2
- package/dist/vitepress.cjs.map +1 -1
- package/dist/vitepress.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
package/dist/vitepress.cjs
CHANGED
|
@@ -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) => {
|