summaryrefslogtreecommitdiff
path: root/layouts/shortcodes/youtube.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/shortcodes/youtube.html')
-rw-r--r--layouts/shortcodes/youtube.html12
1 files changed, 9 insertions, 3 deletions
diff --git a/layouts/shortcodes/youtube.html b/layouts/shortcodes/youtube.html
index f9d720e0..0b889329 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>