tpl: Add another class and an id to youtube_simple

To provide some more styling options.

See #4616
This commit is contained in:
Bjørn Erik Pedersen 2018-05-22 09:11:34 +02:00
parent 69ee6b41e3
commit 14705ecead
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
2 changed files with 6 additions and 2 deletions

View file

@ -341,7 +341,9 @@ M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.5
{{/* If class is set, assume the user wants to provide his own styles. */}}
{{ template "__h_simple_css" $ }}
{{ end }}
<div class="{{ $class }}">
{{ $secondClass := "s_youtube_simple" }}
{{ $divID := printf "%s_%d" $secondClass (add $.Ordinal 1) }}
<div class="{{ $secondClass }} {{ $class }}" id="{{ $divID }}">
{{ $tb := printf "//i.ytimg.com/vi/%s/" $id }}
<a href="//youtube.com/watch?v={{ $id | safeHTMLAttr }}" target="_blank">
<img src="{{ printf "%smaxresdefault.jpg" $tb }}" srcset="{{ printf "%shqdefault.jpg" $tb }} 1x {{ printf "%smaxresdefault.jpg" $tb }} 2x" alt="Video">

View file

@ -6,7 +6,9 @@
{{/* If class is set, assume the user wants to provide his own styles. */}}
{{ template "__h_simple_css" $ }}
{{ end }}
<div class="{{ $class }}">
{{ $secondClass := "s_youtube_simple" }}
{{ $divID := printf "%s_%d" $secondClass (add $.Ordinal 1) }}
<div class="{{ $secondClass }} {{ $class }}" id="{{ $divID }}">
{{ $tb := printf "//i.ytimg.com/vi/%s/" $id }}
<a href="//youtube.com/watch?v={{ $id | safeHTMLAttr }}" target="_blank">
<img src="{{ printf "%smaxresdefault.jpg" $tb }}" srcset="{{ printf "%shqdefault.jpg" $tb }} 1x {{ printf "%smaxresdefault.jpg" $tb }} 2x" alt="Video">