From 54ffce5611777c3d4666bd5053b4b0babae86089 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Wed, 19 Dec 2012 00:17:47 -0600 Subject: [PATCH] added figcaption with source link to embeded gist code snippets --- plugins/gist_tag.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/gist_tag.rb b/plugins/gist_tag.rb index 545db5b..dd84bee 100644 --- a/plugins/gist_tag.rb +++ b/plugins/gist_tag.rb @@ -72,7 +72,9 @@ module Jekyll request = Net::HTTP::Get.new raw_uri.request_uri data = https.request request lang = file.empty? ? '' : file.split('.')[-1] - data = highlight(data.body, lang, { linenos: true, start: 1 }) + link = "https://gist.github.com/#{gist}" + caption = file.empty? ? "Gist: #{gist}" : file + data = highlight(data.body, lang, { linenos: true, start: 1, caption: caption, url: link, anchor: 'View Gist' }) cache gist, file, data unless @cache_disabled data