Skip to content

Commit

Permalink
use absolute_url to generate the feed_meta url
Browse files Browse the repository at this point in the history
  • Loading branch information
benbalter committed Dec 30, 2016
1 parent 9568a5e commit bf728c3
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lib/jekyll/feed_meta_tag.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module Jekyll
class FeedMetaTag < Liquid::Tag
# Use Jekyll's native relative_url filter
include Jekyll::Filters::URLFilters

def render(context)
@context = context
attrs = attributes.map { |k, v| %(#{k}="#{v}") }.join(" ")
Expand All @@ -16,7 +19,7 @@ def attributes
{
:type => "application/atom+xml",
:rel => "alternate",
:href => "#{url}/#{path}",
:href => absolute_url(path),
:title => title
}.keep_if { |_, v| v }
end
Expand All @@ -29,14 +32,6 @@ def path
end
end

def url
if config["url"]
URI.join(config["url"], config["baseurl"])
elsif config["github"] && config["github"]["url"]
config["github"]["url"]
end
end

def title
config["title"] || config["name"]
end
Expand Down

0 comments on commit bf728c3

Please sign in to comment.