class JekyllFeed::MetaTag
Public Instance Methods
render(context)
click to toggle source
# File lib/jekyll-feed/meta-tag.rb, line 8 def render(context) @context = context attrs = attributes.map do |k, v| v = v.to_s unless v.respond_to?(:encode) %(#{k}=#{v.encode(:xml => :attr)}) end "<link #{attrs.join(" ")} />" end
Private Instance Methods
attributes()
click to toggle source
# File lib/jekyll-feed/meta-tag.rb, line 23 def attributes { :type => "application/atom+xml", :rel => "alternate", :href => absolute_url(path), :title => title, }.keep_if { |_, v| v } end
config()
click to toggle source
# File lib/jekyll-feed/meta-tag.rb, line 19 def config @config ||= @context.registers[:site].config end
path()
click to toggle source
# File lib/jekyll-feed/meta-tag.rb, line 32 def path config.dig("feed", "path") || "feed.xml" end
title()
click to toggle source
# File lib/jekyll-feed/meta-tag.rb, line 36 def title config["title"] || config["name"] end