diff --git a/_includes/components/sections/featured-posts.njk b/_includes/components/sections/featured-posts.njk index 75230b1..706b226 100644 --- a/_includes/components/sections/featured-posts.njk +++ b/_includes/components/sections/featured-posts.njk @@ -59,9 +59,10 @@ {{ post.date | dateDisplay }} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (likedUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {{ likedUrl | unfurlCard | safe }} @@ -98,9 +99,10 @@ {{ post.data.title }} {% endif %} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (bookmarkedUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {{ bookmarkedUrl | unfurlCard | safe }} @@ -132,9 +134,10 @@ {{ post.date | dateDisplay }} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (repostedUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {{ repostedUrl | unfurlCard | safe }} @@ -166,9 +169,10 @@ {{ post.date | dateDisplay }} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (replyToUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {{ replyToUrl | unfurlCard | safe }} diff --git a/_includes/components/sections/recent-posts.njk b/_includes/components/sections/recent-posts.njk index 6fa3638..e39aa34 100644 --- a/_includes/components/sections/recent-posts.njk +++ b/_includes/components/sections/recent-posts.njk @@ -75,9 +75,10 @@ {% endif %} {% include "components/garden-badge.njk" %} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (likedUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {{ likedUrl | unfurlCard | safe }} @@ -126,9 +127,10 @@ {{ post.data.title }} {% endif %} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (bookmarkedUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {{ bookmarkedUrl | unfurlCard | safe }} @@ -172,9 +174,10 @@ {% endif %} {% include "components/garden-badge.njk" %} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (repostedUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {{ repostedUrl | unfurlCard | safe }} @@ -218,9 +221,10 @@ {% endif %} {% include "components/garden-badge.njk" %} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (replyToUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {{ replyToUrl | unfurlCard | safe }} diff --git a/blog.njk b/blog.njk index f686b1e..21b4acb 100644 --- a/blog.njk +++ b/blog.njk @@ -83,9 +83,10 @@ permalink: "blog/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumber {% endif %} {% include "components/garden-badge.njk" %} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (likedUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {% unfurl likedUrl %} @@ -136,9 +137,10 @@ permalink: "blog/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumber {{ post.data.title }} {% endif %} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (bookmarkedUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {% unfurl bookmarkedUrl %} @@ -184,9 +186,10 @@ permalink: "blog/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumber {% endif %} {% include "components/garden-badge.njk" %} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (repostedUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {% unfurl repostedUrl %} @@ -232,9 +235,10 @@ permalink: "blog/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumber {% endif %} {% include "components/garden-badge.njk" %} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (replyToUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {% unfurl replyToUrl %} diff --git a/bookmarks.njk b/bookmarks.njk index fe0cfd9..81c9261 100644 --- a/bookmarks.njk +++ b/bookmarks.njk @@ -55,9 +55,10 @@ 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 %} + {% set _ytId = post.data.youtubeVideoId or (bookmarkedUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {% unfurl bookmarkedUrl %} diff --git a/likes.njk b/likes.njk index 588c81e..90f6485 100644 --- a/likes.njk +++ b/likes.njk @@ -53,9 +53,10 @@ permalink: "likes/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumbe {# Support both camelCase (Indiekit Eleventy preset) and underscore (legacy) property names #} {% set likedUrl = post.data.likeOf or post.data.like_of %} {% if likedUrl %} - {% if post.data.youtubeVideoId %} + {% set _ytId = post.data.youtubeVideoId or (likedUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {% unfurl likedUrl %} diff --git a/replies.njk b/replies.njk index fcba4e0..1010d6c 100644 --- a/replies.njk +++ b/replies.njk @@ -59,9 +59,10 @@ 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 %} + {% set _ytId = post.data.youtubeVideoId or (replyTo | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {% unfurl replyTo %} diff --git a/reposts.njk b/reposts.njk index 54a91f8..7b6358c 100644 --- a/reposts.njk +++ b/reposts.njk @@ -58,9 +58,10 @@ 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 %} + {% set _ytId = post.data.youtubeVideoId or (repostedUrl | youtubeId) %} + {% if _ytId %}
-
+
{% else %} {% unfurl repostedUrl %}