feat: added a tag to allow for featured notes
This commit is contained in:
+3
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user