fix: register sameTargetPosts filter missing from previous commit
Build & Deploy / build-and-deploy (push) Successful in 1m38s
Build & Deploy / build-and-deploy (push) Successful in 1m38s
The post.njk template was committed with the sameTargetPosts filter call but the filter registration in eleventy.config.js was not included, causing the CI build to fail. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1364,6 +1364,21 @@ export default function (eleventyConfig) {
|
||||
return result;
|
||||
});
|
||||
|
||||
// Find other published posts that share the same external target URL
|
||||
// (repostOf, likeOf, bookmarkOf, inReplyTo). Used to cross-link related posts.
|
||||
eleventyConfig.addFilter("sameTargetPosts", function (posts, targetUrl, currentUrl) {
|
||||
if (!targetUrl) return [];
|
||||
const norm = (u) => String(u).replace(/\/$/, "");
|
||||
const t = norm(targetUrl);
|
||||
return (posts || []).filter((p) => {
|
||||
if (norm(p.url) === norm(currentUrl)) return false;
|
||||
const d = p.data;
|
||||
return [d.repostOf, d.repost_of, d.likeOf, d.like_of,
|
||||
d.bookmarkOf, d.bookmark_of, d.inReplyTo, d.in_reply_to]
|
||||
.some((v) => v && norm(v) === t);
|
||||
});
|
||||
});
|
||||
|
||||
// Strip garden/* tags from a category list so they don't render as
|
||||
// plain category pills alongside the garden badge.
|
||||
eleventyConfig.addFilter("withoutGardenTags", (categories) => {
|
||||
|
||||
Reference in New Issue
Block a user