feat: linked articles in header
This commit is contained in:
+5
-2
@@ -3,6 +3,7 @@ import markdownIt from "markdown-it";
|
||||
import markdownItAnchor from "markdown-it-anchor";
|
||||
import { filters } from "./src/_filters/index.js";
|
||||
import { postComparator, isPostPublic } from "./src/_utils/sort-posts.js";
|
||||
import { validateLinkedArticles } from "./src/_utils/linked-articles.js";
|
||||
|
||||
export default function (eleventyConfig) {
|
||||
// Build ignored local post fixtures without making them Git-tracked.
|
||||
@@ -44,8 +45,10 @@ export default function (eleventyConfig) {
|
||||
// 5. Custom Collections
|
||||
// Pinned / featured prioritized, chronological blog posts collection (excludes drafts and hidden posts)
|
||||
eleventyConfig.addCollection("posts", (collectionApi) => {
|
||||
return collectionApi
|
||||
.getFilteredByGlob("src/posts/*.md")
|
||||
const allPosts = collectionApi.getFilteredByGlob("src/posts/*.md");
|
||||
validateLinkedArticles(allPosts);
|
||||
|
||||
return allPosts
|
||||
.filter((post) => isPostPublic(post))
|
||||
.sort(postComparator);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user