module Jekyll::Favicon::StaticFile::Taggable

Add tags to favicon's static files

Public Instance Methods

taggable?() click to toggle source
# File lib/jekyll/favicon/static_file/taggable.rb, line 14
def taggable?
  tags.any?
end
tags() click to toggle source
# File lib/jekyll/favicon/static_file/taggable.rb, line 18
def tags
  tag_spec.collect do |options|
    tag_name, tag_options = options.first
    tag_defaults = taggable_defaults[tag_name]
    tag_attributes = tag_defaults.merge tag_options
    Utils.build_tag tag_name, patch(tag_attributes)
  end
end

Private Instance Methods

mimetype() click to toggle source
# File lib/jekyll/favicon/static_file/taggable.rb, line 33
def mimetype
  mappings = {
    ".ico" => "image/x-icon",
    ".png" => "image/png",
    ".svg" => "image/svg+xml"
  }
  mappings[extname]
end
tag_spec() click to toggle source
# File lib/jekyll/favicon/static_file/taggable.rb, line 29
def tag_spec
  spec.fetch "tag", []
end
taggable_patch(configuration) click to toggle source
# File lib/jekyll/favicon/static_file/taggable.rb, line 42
def taggable_patch(configuration)
  Favicon::Utils.patch configuration do |value|
    case value
    when :mime then mimetype
    else value
    end
  end
end