Skip to content

Commit 0715089

Browse files
committed
fix(site): add rel=0 to YouTube embeds so More Videos stays on CodingCat.dev
1 parent 1979d96 commit 0715089

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/site/src/components/portable-text/PortableTextContent.astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ const components = {
207207
return;
208208
}
209209
const iframe = document.createElement("iframe");
210-
iframe.src = `https://www.youtube-nocookie.com/embed/${id}?autoplay=1&fs=0`;
210+
iframe.src = `https://www.youtube-nocookie.com/embed/${id}?autoplay=1&rel=0&modestbranding=1&fs=0`;
211211
iframe.allow =
212212
"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share";
213213
iframe.allowFullscreen = true;

‎apps/site/src/lib/structured-data.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export function videoObjectSchema(
230230
video.thumbnailUrl ||
231231
(ytId ? `https://i.ytimg.com/vi/${ytId}/hqdefault.jpg` : undefined);
232232
const embedUrl = ytId
233-
? `https://www.youtube.com/embed/${ytId}`
233+
? `https://www.youtube.com/embed/${ytId}?rel=0`
234234
: video.youtubeUrl
235235
.replace("watch?v=", "embed/")
236236
.replace("youtu.be/", "www.youtube.com/embed/");

0 commit comments

Comments
 (0)