2018-05-21 15:34:21 +00:00
|
|
|
{{ $id := .Get "id" | default (.Get 0) }}
|
|
|
|
{{ $class := .Get "class" | default (.Get 1) }}
|
|
|
|
{{ $hasClass := $class }}
|
|
|
|
{{ $class := $class | default "__h_youtube" }}
|
|
|
|
{{ if not $hasClass }}
|
|
|
|
{{/* If class is set, assume the user wants to provide his own styles. */}}
|
|
|
|
{{ template "__h_simple_css" $ }}
|
|
|
|
{{ end }}
|
2018-05-22 07:11:34 +00:00
|
|
|
{{ $secondClass := "s_youtube_simple" }}
|
|
|
|
{{ $divID := printf "%s_%d" $secondClass (add $.Ordinal 1) }}
|
|
|
|
<div class="{{ $secondClass }} {{ $class }}" id="{{ $divID }}">
|
2018-05-21 20:25:04 +00:00
|
|
|
{{ $tb := printf "//i.ytimg.com/vi/%s/" $id }}
|
|
|
|
<a href="//youtube.com/watch?v={{ $id | safeHTMLAttr }}" target="_blank">
|
2018-05-21 15:34:21 +00:00
|
|
|
<img src="{{ printf "%smaxresdefault.jpg" $tb }}" srcset="{{ printf "%shqdefault.jpg" $tb }} 1x {{ printf "%smaxresdefault.jpg" $tb }} 2x" alt="Video">
|
|
|
|
<div class="play"><svg height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-large-play-button-bg" d="{{ template "__h_simple_icon_play" $ }}" fill="#212121" fill-opacity="0.8"></path><path d="M 45,24 27,14 27,34" fill="#fff"></path></svg></div></a></div>
|