ref: 14705ecead09a0ad8dfa4de2d9b5ba9188c32d07
parent: 69ee6b41e36625595e2bcabcde0bc58663e5b93c
author: Bjørn Erik Pedersen <[email protected]>
date: Tue May 22 05:11:34 EDT 2018
tpl: Add another class and an id to youtube_simple To provide some more styling options. See #4616
--- a/tpl/tplimpl/embedded/templates.autogen.go
+++ b/tpl/tplimpl/embedded/templates.autogen.go
@@ -341,7 +341,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">
--- a/tpl/tplimpl/embedded/templates/shortcodes/youtube_simple.html
+++ b/tpl/tplimpl/embedded/templates/shortcodes/youtube_simple.html
@@ -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">