mirror of
https://github.com/svemagie/indiekit-endpoint-youtube.git
synced 2026-04-02 15:54:59 +02:00
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:
@@ -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",
|
||||||
@@ -300,12 +296,4 @@ export function startLikesSync(Indiekit, options) {
|
|||||||
run().catch(() => {});
|
run().catch(() => {});
|
||||||
setInterval(() => run().catch(() => {}), interval);
|
setInterval(() => run().catch(() => {}), interval);
|
||||||
}, 15_000);
|
}, 15_000);
|
||||||
}
|
}
|
||||||
|
|
||||||
function escapeHtml(str) {
|
|
||||||
return String(str)
|
|
||||||
.replace(/&/g, "&")
|
|
||||||
.replace(/</g, "<")
|
|
||||||
.replace(/>/g, ">")
|
|
||||||
.replace(/"/g, """);
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user