Last active
January 27, 2016 06:10
-
-
Save razor-x/2f62cff9eaae2fcd8cee to your computer and use it in GitHub Desktop.
Jekyll plugin for gist-async that modifies the gist markup added by its gist Liquid tag.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Overrides the gist markup added by Jekyll's gist Liquid tag | |
# to support loading GitHub Gists asynchronously using gist-async from | |
# https://github.com/razor-x/gist-async | |
# Must load the jekyll-gist plugin: | |
# https://github.com/jekyll/jekyll-gist | |
require 'jekyll-gist' | |
module Jekyll | |
module Gist | |
class GistTag | |
def gist_script_tag(gist_id, filename = nil) | |
file_data_attr = filename.empty? ? '' : %Q{ data-gist-file="#{filename}"} | |
# Append additional markup to this string that will be replaced on gist load. | |
inner = '' | |
%Q{<div class="gist" data-gist="#{gist_id}"#{file_data_attr}>#{inner}</div>} | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment