Add tv page posters with preload

This commit is contained in:
Sam Carlton 2021-05-15 18:28:51 -05:00
parent 5cfcd5a7aa
commit 7b004ea590
3 changed files with 51 additions and 17 deletions

View file

@ -68,6 +68,23 @@ class TV {
return makeDescription( data.tvEntry )
},
headLinkTags: data => {
// Declare dependencies for Eleventy
// https://www.11ty.dev/docs/data-computed/#declaring-your-dependencies
data.tvEntry
return [
// Preload video thumbnail
// <link rel="preload" as="image" href="img.png" />
{
'rel': 'preload',
'as': 'image',
'href': `https://i.ytimg.com/vi_webp/${ data.tvEntry.payload.video.id }/sddefault.webp`
},
]
},
structuredData: data => {
// Declare dependencies for Eleventy
// https://www.11ty.dev/docs/data-computed/#declaring-your-dependencies