Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use absolute_url to generate the feed_meta url #150

Merged
merged 1 commit into from
Dec 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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