fix: use pinned property for featuredPosts collection
Renamed from "featured" to "pinned" to avoid conflict with the "featured" hero image property in MF2/Micropub. Handles both boolean and string "true" values from YAML frontmatter. Confab-Link: http://localhost:8080/sessions/bd3f7012-c703-47e9-bfe2-2ad04ce1842d
This commit is contained in:
@@ -856,12 +856,13 @@ export default function (eleventyConfig) {
|
||||
.slice(0, 5);
|
||||
});
|
||||
|
||||
// Featured posts — curated selection via `featured: true` frontmatter
|
||||
// Featured posts — curated selection via `pinned: true` frontmatter
|
||||
// Property named "pinned" to avoid conflict with "featured" (hero image) in MF2/Micropub
|
||||
eleventyConfig.addCollection("featuredPosts", function (collectionApi) {
|
||||
return collectionApi
|
||||
.getFilteredByGlob("content/**/*.md")
|
||||
.filter(isPublished)
|
||||
.filter((item) => item.data.featured === true)
|
||||
.filter((item) => item.data.pinned === true || item.data.pinned === "true")
|
||||
.sort((a, b) => b.date - a.date);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user