From 24e7a58029e3fdf147d5b387f3b60c4c4a917f8d Mon Sep 17 00:00:00 2001
From: svemagie <869694+svemagie@users.noreply.github.com>
Date: Sat, 11 Apr 2026 19:28:52 +0200
Subject: [PATCH] fix: extend youtubeVideoId embed guard to all post types and
templates
Reposts, bookmarks, replies, and in-reply-to sections were still falling
through to {% unfurl %} for YouTube URLs. Extended the lite-youtube embed
check (youtubeVideoId frontmatter) to every place that renders an external
URL: reply-context.njk (repost/in-reply-to/bookmark), blog.njk (bookmark/
repost/reply branches), reposts.njk, bookmarks.njk, replies.njk, and the
recent-posts and featured-posts homepage widget sections.
Co-Authored-By: Claude Sonnet 4.6
---
_includes/components/reply-context.njk | 18 ++++++++++++++
.../components/sections/featured-posts.njk | 24 +++++++++++++++++++
.../components/sections/recent-posts.njk | 24 +++++++++++++++++++
blog.njk | 18 ++++++++++++++
bookmarks.njk | 6 +++++
replies.njk | 6 +++++
reposts.njk | 6 +++++
7 files changed, 102 insertions(+)
diff --git a/_includes/components/reply-context.njk b/_includes/components/reply-context.njk
index e5cb9a7..782f393 100644
--- a/_includes/components/reply-context.njk
+++ b/_includes/components/reply-context.njk
@@ -19,7 +19,13 @@
In reply to:
+ {% if youtubeVideoId %}
+
+ {% else %}
{% unfurl replyTo %}
+ {% endif %}
{{ replyTo }}
@@ -55,7 +61,13 @@
Reposted:
+ {% if youtubeVideoId %}
+
+ {% else %}
{% unfurl repostedUrl %}
+ {% endif %}
{{ repostedUrl }}
@@ -70,7 +82,13 @@
Bookmarked:
+ {% if youtubeVideoId %}
+
+ {% else %}
{% unfurl bookmarkedUrl %}
+ {% endif %}
{{ bookmarkedUrl }}
diff --git a/_includes/components/sections/featured-posts.njk b/_includes/components/sections/featured-posts.njk
index 8ecb893..75230b1 100644
--- a/_includes/components/sections/featured-posts.njk
+++ b/_includes/components/sections/featured-posts.njk
@@ -59,7 +59,13 @@
{{ post.date | dateDisplay }}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{{ likedUrl | unfurlCard | safe }}
+ {% endif %}
{{ likedUrl }}
@@ -92,7 +98,13 @@
{{ post.data.title }}
{% endif %}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{{ bookmarkedUrl | unfurlCard | safe }}
+ {% endif %}
{{ bookmarkedUrl }}
@@ -120,7 +132,13 @@
{{ post.date | dateDisplay }}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{{ repostedUrl | unfurlCard | safe }}
+ {% endif %}
{{ repostedUrl }}
@@ -148,7 +166,13 @@
{{ post.date | dateDisplay }}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{{ replyToUrl | unfurlCard | safe }}
+ {% endif %}
{{ replyToUrl }}
diff --git a/_includes/components/sections/recent-posts.njk b/_includes/components/sections/recent-posts.njk
index ba631dd..6fa3638 100644
--- a/_includes/components/sections/recent-posts.njk
+++ b/_includes/components/sections/recent-posts.njk
@@ -75,7 +75,13 @@
{% endif %}
{% include "components/garden-badge.njk" %}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{{ likedUrl | unfurlCard | safe }}
+ {% endif %}
{{ likedUrl }}
@@ -120,7 +126,13 @@
{{ post.data.title }}
{% endif %}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{{ bookmarkedUrl | unfurlCard | safe }}
+ {% endif %}
{{ bookmarkedUrl }}
@@ -160,7 +172,13 @@
{% endif %}
{% include "components/garden-badge.njk" %}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{{ repostedUrl | unfurlCard | safe }}
+ {% endif %}
{{ repostedUrl }}
@@ -200,7 +218,13 @@
{% endif %}
{% include "components/garden-badge.njk" %}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{{ replyToUrl | unfurlCard | safe }}
+ {% endif %}
{{ replyToUrl }}
diff --git a/blog.njk b/blog.njk
index e5a5a3d..f686b1e 100644
--- a/blog.njk
+++ b/blog.njk
@@ -136,7 +136,13 @@ permalink: "blog/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumber
{{ post.data.title }}
{% endif %}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{% unfurl bookmarkedUrl %}
+ {% endif %}
{{ bookmarkedUrl }}
@@ -178,7 +184,13 @@ permalink: "blog/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumber
{% endif %}
{% include "components/garden-badge.njk" %}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{% unfurl repostedUrl %}
+ {% endif %}
{{ repostedUrl }}
@@ -220,7 +232,13 @@ permalink: "blog/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumber
{% endif %}
{% include "components/garden-badge.njk" %}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{% unfurl replyToUrl %}
+ {% endif %}
{{ replyToUrl }}
diff --git a/bookmarks.njk b/bookmarks.njk
index e7919bb..fe0cfd9 100644
--- a/bookmarks.njk
+++ b/bookmarks.njk
@@ -55,7 +55,13 @@ permalink: "bookmarks/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageN
{# Support both camelCase (Indiekit Eleventy preset) and underscore (legacy) property names #}
{% set bookmarkedUrl = post.data.bookmarkOf or post.data.bookmark_of %}
{% if bookmarkedUrl %}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{% unfurl bookmarkedUrl %}
+ {% endif %}
{{ bookmarkedUrl }}
diff --git a/replies.njk b/replies.njk
index 88e076e..fcba4e0 100644
--- a/replies.njk
+++ b/replies.njk
@@ -59,7 +59,13 @@ permalink: "replies/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNum
{% set replyTo = post.data.inReplyTo or post.data.in_reply_to %}
{% if replyTo %}
{% set protocol = replyTo | protocolType %}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{% unfurl replyTo %}
+ {% endif %}
In reply to:
diff --git a/reposts.njk b/reposts.njk
index 8b9a4fa..54a91f8 100644
--- a/reposts.njk
+++ b/reposts.njk
@@ -58,7 +58,13 @@ permalink: "reposts/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNum
{# Support both camelCase (Indiekit Eleventy preset) and underscore (legacy) property names #}
{% set repostedUrl = post.data.repostOf or post.data.repost_of %}
{% if repostedUrl %}
+ {% if post.data.youtubeVideoId %}
+
+ {% else %}
{% unfurl repostedUrl %}
+ {% endif %}
{{ repostedUrl }}