feat: added a tag to allow for featured notes

This commit is contained in:
venus
2026-09-22 16:52:58 -05:00
parent f77b43c766
commit 2c22255855
4 changed files with 167 additions and 3 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
import markdownIt from "markdown-it";
import markdownItAnchor from "markdown-it-anchor";
import { filters } from "./src/_filters/index.js";
import { postComparator } from "./src/_utils/sort-posts.js";
export default function (eleventyConfig) {
// 1. Static Asset Passthrough Copy
@@ -38,12 +39,12 @@ export default function (eleventyConfig) {
}
// 5. Custom Collections
// Chronological blog posts collection
// Pinned / featured prioritized, chronological blog posts collection
eleventyConfig.addCollection("posts", (collectionApi) => {
return collectionApi
.getFilteredByGlob("src/posts/*.md")
.filter((post) => !post.data.draft)
.sort((a, b) => b.date - a.date);
.sort(postComparator);
});
// Dynamic Tag List Collection across all posts