@@ -6,7 +6,7 @@ import DocActions from '@/components/DocActions.astro';
66import TableOfContents from ' @/components/TableOfContents.astro' ;
77import ReportIssue from ' @/components/ReportIssue.astro' ;
88import Icon from ' @/components/Icon.astro' ;
9- import { VIDEOS , getPlaylist , watchUrl , videosInPlaylist , playlistNeighbors } from ' @/data/videos' ;
9+ import { VIDEOS , getPlaylist , watchUrl , videosInPlaylist , playlistNeighbors , thumbnail } from ' @/data/videos' ;
1010import { getTranscript } from ' @/lib/transcripts' ;
1111import { SITE } from ' @/config' ;
1212
@@ -39,13 +39,17 @@ const { prev, next } = primaryPlaylist
3939const url = new URL (` /video/${video .slug } ` , SITE .url ).href ;
4040const mdUrl = ` /video/${video .slug }.md ` ;
4141
42+ // Social-share image: the YouTube maxres thumbnail (absolute raster URL) so LinkedIn/X/Facebook
43+ // render the video's own card instead of falling back to the branded /og-default.png.
44+ const ogImage = thumbnail (video .youtubeId , ' max' );
45+
4246const jsonLd = [
4347 {
4448 ' @context' : ' https://schema.org' ,
4549 ' @type' : ' VideoObject' ,
4650 name: video .title ,
4751 description: video .description ,
48- thumbnailUrl: ` https://i.ytimg.com/vi/${ video . youtubeId }/maxresdefault.jpg ` ,
52+ thumbnailUrl: ogImage ,
4953 uploadDate: video .publishedAt ? new Date (video .publishedAt ).toISOString () : undefined ,
5054 contentUrl: watchUrl (video .youtubeId ),
5155 embedUrl: ` https://www.youtube.com/embed/${video .youtubeId } ` ,
@@ -68,6 +72,7 @@ const headings = [...baseHeadings, ...transcriptHeadings.filter((h) => h.depth =
6872 title ={ video .title }
6973 description ={ video .description }
7074 type =" video.other"
75+ image ={ ogImage }
7176 contained ={ false }
7277 jsonLd ={ jsonLd }
7378>
0 commit comments