mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
fix: support camelCase property names from Indiekit Eleventy preset
The Indiekit Eleventy preset uses camelcaseKeys to convert frontmatter properties (e.g., bookmark-of → bookmarkOf), but templates expected underscore-separated names (bookmark_of). Changes: - Support both camelCase and underscore property names in all templates - Update collections to filter on both property name formats - Include interaction URLs (bookmarks, likes, replies, reposts) in Bridgy syndication content for proper social media posting Fixes bookmark URLs not appearing on posts or in syndicated content. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -316,19 +316,21 @@ export default function (eleventyConfig) {
|
||||
.sort((a, b) => b.date - a.date);
|
||||
});
|
||||
|
||||
// Replies collection - posts with in_reply_to property
|
||||
// Replies collection - posts with inReplyTo/in_reply_to property
|
||||
// Supports both camelCase (Indiekit Eleventy preset) and underscore (legacy) names
|
||||
eleventyConfig.addCollection("replies", function (collectionApi) {
|
||||
return collectionApi
|
||||
.getAll()
|
||||
.filter((item) => item.data.in_reply_to)
|
||||
.filter((item) => item.data.inReplyTo || item.data.in_reply_to)
|
||||
.sort((a, b) => b.date - a.date);
|
||||
});
|
||||
|
||||
// Reposts collection - posts with repost_of property
|
||||
// Reposts collection - posts with repostOf/repost_of property
|
||||
// Supports both camelCase (Indiekit Eleventy preset) and underscore (legacy) names
|
||||
eleventyConfig.addCollection("reposts", function (collectionApi) {
|
||||
return collectionApi
|
||||
.getAll()
|
||||
.filter((item) => item.data.repost_of)
|
||||
.filter((item) => item.data.repostOf || item.data.repost_of)
|
||||
.sort((a, b) => b.date - a.date);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user