From: Konstantin Kliakhandler Date: Fri, 11 Mar 2016 14:02:57 +0000 (-0600) Subject: Allow picking a specific file out of a gist X-Git-Tag: v0.16~256 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e9008b91fa0d5b0cc79c1133cd3658134ed6777d;p=brevno-suite%2Fhugo Allow picking a specific file out of a gist --- diff --git a/docs/content/extras/shortcodes.md b/docs/content/extras/shortcodes.md index 34c6f348..68dbb668 100644 --- a/docs/content/extras/shortcodes.md +++ b/docs/content/extras/shortcodes.md @@ -211,6 +211,10 @@ pass the owner and the ID of the gist to the shortcode: {{}} +If the gist contains several files and you want to quote just one of them, you can pass the filename (quoted) as an optional third argument: + + {{}} + ### Speaker Deck To embed slides from [Speaker Deck](https://speakerdeck.com/), click on "< /> Embed" (under Share right next to the template on Speaker Deck) and copy the URL, e.g.: diff --git a/tpl/template_embedded.go b/tpl/template_embedded.go index 53f5c0f5..dae36a29 100644 --- a/tpl/template_embedded.go +++ b/tpl/template_embedded.go @@ -58,7 +58,7 @@ func (t *GoHTMLTemplate) EmbedShortcodes() { {{ end }}`) - t.AddInternalShortcode("gist.html", ``) + t.AddInternalShortcode("gist.html", ``) t.AddInternalShortcode("tweet.html", `{{ (getJSON "https://api.twitter.com/1/statuses/oembed.json?id=" (index .Params 0)).html | safeHTML }}`) }