Skip to content

Commit

Permalink
✨ feat(youtube): add AMP image placeholder for YouTube videos
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskyfung committed Feb 3, 2025
1 parent 1af161d commit 206a591
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions _includes/youtube.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
data-block-on-consent-purposes="1,3"
{% endcase -%}
credentials="omit" data-videoid="{{- include.id -}}"{{ attrs_for_playlist }}{{ attr_title }}{{ data_vars }} data-param-rel="0">
<amp-img
src="https://i.ytimg.com/vi/{{- include.id -}}/mqdefault.jpg"
placeholder
layout="fill"
/>
<div fallback>
<p>This browser does not support the YouTube video player. <a href="{{- video_url -}}" rel="noopener" target="_blank">Watch on YouTube</a></p>
</div>
Expand Down

0 comments on commit 206a591

Please sign in to comment.