Sha256: af56dc70ad94308bcac4dae967cf692ca3f73e27d202295f3efb6d44e5c88f0f
Contents?: true
Size: 847 Bytes
Versions: 7
Compression:
Stored size: 847 Bytes
Contents
module Jekyll module Favicon # New `favicon` tag for favicon include on templates class Tag < Liquid::Tag def initialize(tag_name, text, tokens) super @text = text end def render(context) site = context.registers[:site] prepend_path = site.baseurl || '' templates_dir = Favicon.templates head = "<!-- Begin Jekyll Favicon tag v#{Favicon::VERSION} -->" body = %w[classic safari chrome ie].collect do |template| template_path = File.join templates_dir, "#{template}.html.erb" ERB.new(File.read(template_path), nil, '-').result(binding).strip end foot = '<!-- End Jekyll Favicon tag -->' [head, body.join("\n"), foot].join("\n") end end end end Liquid::Template.register_tag('favicon', Jekyll::Favicon::Tag)
Version data entries
7 entries across 7 versions & 1 rubygems