feat: add youtube shortcode

This commit is contained in:
Devin Haska 2024-02-18 00:10:31 -08:00
parent 4c1b65ac93
commit 77da511139
11 changed files with 46 additions and 15 deletions

View file

@ -0,0 +1,14 @@
/* Sourced from eleventy-excellent's youtube shortcode
* https://github.com/madrilene/eleventy-excellent/blob/main/config/shortcodes/youtube-lite/index.js
*/
const liteYoutube = (id, label) => {
return `
<div class="youtube-embed"> <lite-youtube videoid="${id}" style="background-image: url('https://i.ytimg.com/vi/${id}/hqdefault.jpg');">
<button type="button" class="lty-playbtn">
<span class="lyt-visually-hidden">${label}</span>
</button>
</lite-youtube></div>
`;
};
module.exports = liteYoutube;