Skip to content

Commit

Permalink
Return relative_url if site.url is an empty string (#7988)
Browse files Browse the repository at this point in the history
Merge pull request 7988
  • Loading branch information
ashmaroli committed Jan 31, 2020
1 parent f3b4cad commit 5da8271
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/jekyll/filters/url_filters.rb
Expand Up @@ -44,10 +44,11 @@ def compute_absolute_url(input)
return input if Addressable::URI.parse(input.to_s).absolute?

site = @context.registers[:site]
return relative_url(input) if site.config["url"].nil?
site_url = site.config["url"]
return relative_url(input) if site_url.nil? || site_url == ""

Addressable::URI.parse(
site.config["url"].to_s + relative_url(input)
site_url.to_s + relative_url(input)
).normalize.to_s
end

Expand Down

0 comments on commit 5da8271

Please sign in to comment.