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:
Ricardo
2026-01-24 16:34:08 +01:00
parent 96182cb1e4
commit f7db31ac27
7 changed files with 55 additions and 31 deletions

View File

@@ -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);
});