Add shortcode for github gists
authordigitalcraftsman <digitalcraftsman@users.noreply.github.com>
Fri, 20 Nov 2015 17:38:56 +0000 (18:38 +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 99a4c15023fb352dabbc781a502b8053d507fd29..5ae37a34005e733aedf03f696ad9fa1201a317f4 100644 (file)
@@ -46,6 +46,7 @@ func (t *GoHTMLTemplate) EmbedShortcodes() {
        t.AddInternalShortcode("vimeo.html", `<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
   <iframe src="//player.vimeo.com/video/{{ index .Params 0 }}" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
 </div>`)
+       t.AddInternalShortcode("gist.html", `<script src="https://gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js"></script>`)
 }
 
 func (t *GoHTMLTemplate) EmbedTemplates() {