class JekyllJsonFeed::MetaTag
Public Instance Methods
render(context)
click to toggle source
# File lib/jekyll-json-feed/meta-tag.rb, line 6 def render(context) @context = context attrs = attributes.map { |k, v| %(#{k}="#{v}") }.join(" ") "<link #{attrs} />" end
Private Instance Methods
attributes()
click to toggle source
# File lib/jekyll-json-feed/meta-tag.rb, line 18 def attributes { :type => "application/json", :rel => "alternate", :href => absolute_url(path), :title => title, }.keep_if { |_, v| v } end
config()
click to toggle source
# File lib/jekyll-json-feed/meta-tag.rb, line 14 def config @context.registers[:site].config end
path()
click to toggle source
# File lib/jekyll-json-feed/meta-tag.rb, line 27 def path if config["json_feed"] && config["json_feed"]["path"] config["json_feed"]["path"] else "feed.json" end end
title()
click to toggle source
# File lib/jekyll-json-feed/meta-tag.rb, line 35 def title config["title"] || config["name"] end