Add shortcode for youtube
authordigitalcraftsman <digitalcraftsman@users.noreply.github.com>
Fri, 20 Nov 2015 17:31:37 +0000 (18:31 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 24 Nov 2015 07:59:32 +0000 (08:59 +0100)
tpl/template_embedded.go

index 79999340237805e955a6c92888307ff151ff2893..b15b6bf40367af574d1740a106e0cd45e8fce51e 100644 (file)
@@ -42,6 +42,7 @@ func (t *GoHTMLTemplate) EmbedShortcodes() {
 </figure>
 <!-- image -->`)
        t.AddInternalShortcode("speakerdeck.html", "<script async class='speakerdeck-embed' data-id='{{ index .Params 0 }}' data-ratio='1.33333333333333' src='https://speakerdeck.com/assets/embed.js'></script>")
+       t.AddInternalShortcode("youtube.html", `<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;"><iframe class="youtube-player" type="text/html" src="https://www.youtube.com/embed/{{ index .Params 0 }}" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen frameborder="0"></iframe></div>`)
 }
 
 func (t *GoHTMLTemplate) EmbedTemplates() {