added figcaption with source link to embeded gist code snippets

This commit is contained in:
Brandon Mathis 2012-12-19 00:17:47 -06:00
parent 280d63f18c
commit 54ffce5611

View File

@ -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