From 26ab9b82b38496aeb5c394506d799ba89581a34a Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Sat, 11 Apr 2026 19:35:40 +0200 Subject: [PATCH] feat: auto-derive youtubeVideoId from URL in reply-context Adds a `youtubeId` filter that extracts the video ID from any YouTube URL (youtube.com?v= and youtu.be/ formats). reply-context.njk now computes youtubeVideoId automatically from the interaction URL fields, so YouTube embeds work without needing youtubeVideoId in post frontmatter. Co-Authored-By: Claude Sonnet 4.6 --- _includes/components/reply-context.njk | 1 + eleventy.config.js | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/_includes/components/reply-context.njk b/_includes/components/reply-context.njk index 782f393..644e87c 100644 --- a/_includes/components/reply-context.njk +++ b/_includes/components/reply-context.njk @@ -8,6 +8,7 @@ {% set likedUrl = likeOf or like_of %} {% set repostedUrl = repostOf or repost_of %} {% set bookmarkedUrl = bookmarkOf or bookmark_of %} +{% set youtubeVideoId = youtubeVideoId or (repostedUrl | youtubeId) or (likedUrl | youtubeId) or (bookmarkedUrl | youtubeId) or (replyTo | youtubeId) %} {% if replyTo or likedUrl or repostedUrl or bookmarkedUrl %}