class Jekyll::FeedMetaTag

Public Instance Methods

render(context) click to toggle source
# File lib/jekyll/feed_meta_tag.rb, line 3
def render(context)
  @context = context
  attrs    = attributes.map { |k, v| %Q(#{k}="#{v}") }.join(' ')
  "<link #{attrs} />"
end

Private Instance Methods

attributes() click to toggle source
# File lib/jekyll/feed_meta_tag.rb, line 15
def attributes
  {
    :type => 'application/atom+xml',
    :rel => 'alternate',
    :href => "#{url}/#{path}",
    :title => title
  }.keep_if { |_, v| v }
end
config() click to toggle source
# File lib/jekyll/feed_meta_tag.rb, line 11
def config
  @context.registers[:site].config
end
path() click to toggle source
# File lib/jekyll/feed_meta_tag.rb, line 24
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 40
def title
  config["title"] || config["name"]
end
url() click to toggle source
# File lib/jekyll/feed_meta_tag.rb, line 32
def url
  if config["url"]
    URI.join(config["url"], config["baseurl"])
  elsif config["github"] && config["github"]["url"]
    config["github"]["url"]
  end
end