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 { |k, v| %(#{k}=#{v.encode(:xml => :attr)}) }.join(" ")
  "<link #{attrs} />"
end

Private Instance Methods

attributes() click to toggle source
# File lib/jekyll-feed/meta-tag.rb, line 20
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 16
def config
  @config ||= @context.registers[:site].config
end
path() click to toggle source
# File lib/jekyll-feed/meta-tag.rb, line 29
def path
  config.dig("feed", "path") || "feed.xml"
end
title() click to toggle source
# File lib/jekyll-feed/meta-tag.rb, line 33
def title
  config["title"] || config["name"]
end