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}") }.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
  @context.registers[:site].config
end
path() click to toggle source
# File lib/jekyll-feed/meta-tag.rb, line 29
def path
  if config["feed"] && config["feed"]["path"]
    config["feed"]["path"]
  else
    "feed.xml"
  end
end
title() click to toggle source
# File lib/jekyll-feed/meta-tag.rb, line 37
def title
  config["title"] || config["name"]
end