diff options
author | Michał M. Sapka <michal@sapka.me> | 2023-02-02 14:52:27 +0100 |
---|---|---|
committer | Michał M. Sapka <michal@sapka.me> | 2023-02-02 14:52:27 +0100 |
commit | c7551da77407a7f589a7fa657f79337f768010f7 (patch) | |
tree | a651684fc76e00441f0d629be07df9d0e2fe1872 /layouts/shortcodes | |
parent | 8525d00965630c8c886812d06dc852928fa88fc5 (diff) |
chore: do not embed yt
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r-- | layouts/shortcodes/youtube.html | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/layouts/shortcodes/youtube.html b/layouts/shortcodes/youtube.html index f9d720e..0b88932 100644 --- a/layouts/shortcodes/youtube.html +++ b/layouts/shortcodes/youtube.html @@ -1,5 +1,11 @@ -{{ $id := .Get 0 }} +{{- $id := .Get 0 }} +{{- $title := .Get 1 }} +{{- $path := printf "ytcovers/%s.jpg" $id}} +{{- $image := resources.Get $path }} +{{- $image = $image.Resize "x300" }} + <center> -<iframe id="ytplayer" type="text/html" width="500" height="280" - src="https://www.youtube.com/embed/{{ $id }}?autoplay=1&origin=https://michal.sapka.me" frameborder="0"></iframe> +<a href="https://www.youtube.com/watch?v={{$id}}" target="_blank"> + <img src="{{$image.Permalink}}" alt="{{$title}} on Youtube"/> +</a> </center> |