From 03c4ba4aea3ac91b48f02ca196522b4042aa9d87 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Thu, 19 Mar 2026 06:37:39 +0100 Subject: [PATCH] fix(og-image): use slug-only path for OG image URL OG images are served at /og/{slug}.png (e.g. /og/14b61.png), not with date prefixes. Remove the date segments from the URL construction in both jf2ToActivityStreams and jf2ToAS2Activity. Co-Authored-By: Claude Opus 4.6 --- lib/jf2-to-as2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jf2-to-as2.js b/lib/jf2-to-as2.js index 00b4824..d1ebc65 100644 --- a/lib/jf2-to-as2.js +++ b/lib/jf2-to-as2.js @@ -165,7 +165,7 @@ export function jf2ToActivityStreams(properties, actorUrl, publicationUrl, optio if (ogMatch) { object.image = { type: "Image", - url: `${publicationUrl.replace(/\/$/, "")}/og/${ogMatch[2]}-${ogMatch[3]}-${ogMatch[4]}-${ogMatch[5]}.png`, + url: `${publicationUrl.replace(/\/$/, "")}/og/${ogMatch[5]}.png`, mediaType: "image/png", }; } @@ -366,7 +366,7 @@ export function jf2ToAS2Activity(properties, actorUrl, publicationUrl, options = const ogMatchF = postUrl && postUrl.match(/\/([\w-]+)\/(\d{4})\/(\d{2})\/(\d{2})\/([\w-]+)\/?$/); if (ogMatchF) { noteOptions.image = new Image({ - url: new URL(`${publicationUrl.replace(/\/$/, "")}/og/${ogMatchF[2]}-${ogMatchF[3]}-${ogMatchF[4]}-${ogMatchF[5]}.png`), + url: new URL(`${publicationUrl.replace(/\/$/, "")}/og/${ogMatchF[5]}.png`), mediaType: "image/png", }); }