fix: remove content property to prevent double video embed

The `content` property caused the video to render twice: once from
the markdown body and once from the `likeOf` frontmatter in the
Eleventy template. Likes now rely solely on `like-of` + `name`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-03-22 09:59:38 +01:00
parent 0191a2a957
commit b8e2b6472f

View File

@@ -190,10 +190,6 @@ export async function syncLikes({ db, youtubeConfig, publication, postsCollectio
"mp-slug": slug, "mp-slug": slug,
"like-of": videoUrl, "like-of": videoUrl,
name: `${video.title} - ${video.channelTitle}`, name: `${video.title} - ${video.channelTitle}`,
content: {
text: `${video.title} - ${video.channelTitle}`,
html: `<a href="${videoUrl}">${escapeHtml(video.title)}</a> - ${escapeHtml(video.channelTitle)}`,
},
published: new Date().toISOString(), published: new Date().toISOString(),
url: postUrl, url: postUrl,
visibility: "public", visibility: "public",
@@ -301,11 +297,3 @@ export function startLikesSync(Indiekit, options) {
setInterval(() => run().catch(() => {}), interval); setInterval(() => run().catch(() => {}), interval);
}, 15_000); }, 15_000);
} }
function escapeHtml(str) {
return String(str)
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;");
}