blob: 6bac5bc2e6c3f0dee03a5f159868776da71ef487 [file] [log] [blame]
require 'yaml'
TERMS = YAML.load(File.open("_data/popovers.yaml"))
module Jekyll
class RenderPopover < Liquid::Tag
def initialize(tag_name, text, tokens)
@original_term = text.strip.split(' ').join(' ')
@term = @original_term.gsub(' ', '-').downcase
@term = 'entry' if @term == 'entries'
@term = 'fencing' if @term == 'fence'
@term = 'striping' if @term == 'stripe' or @term == 'stripedma'
@term = @term[0...-1] if @term.end_with? 's'
end
def render(ctx)
return "<span class=\"pop\" id=\"#{@term}-popover\">#{@original_term}</span>"
end
end
end
Liquid::Template.register_tag('pop', Jekyll::RenderPopover)