module Jekyll::Filters
Public Instance Methods
active_tag_data(site = Tagger.site)
click to toggle source
# File doc/plugins/tags.rb, line 131 def active_tag_data(site = Tagger.site) return site.config['tag_data'] unless site.config['ignored_tags'] site.config['tag_data'].reject { |tag, set| site.config['ignored_tags'].include? tag } end
keywords(obj)
click to toggle source
# File doc/plugins/tags.rb, line 125 def keywords(obj) return '' if not obj['tags'] tags = obj['tags'].dup tags.join(',') end
tag_cloud(site)
click to toggle source
# File doc/plugins/tags.rb, line 101 def tag_cloud(site) active_tag_data.map do |tag, set| tag_link(tag, tag_url(tag), :class => "set-#{set} label label-default") end.join(' ') end
tag_link(tag, url = tag_url(tag), html_opts = nil)
click to toggle source
# File doc/plugins/tags.rb, line 107 def tag_link(tag, url = tag_url(tag), html_opts = nil) html_opts &&= ' ' << html_opts.map { |k, v| %Q{#{k}="#{v}"} }.join(' ') %Q{<a href="#{url}"#{html_opts}>#{tag}</a>} end
tag_url(tag, type = :page, site = Tagger.site)
click to toggle source
# File doc/plugins/tags.rb, line 112 def tag_url(tag, type = :page, site = Tagger.site) # FIXME generate full url for atom.xml page url = File.join('', site.config["tag_#{type}_dir"], ERB::Util.u(tag)) site.permalink_style == :pretty || site.config['tag_permalink_style'] == 'pretty' ? url : url << '.html' end