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

Return relative_url if site.url is an empty string #7988

Merged
merged 1 commit into from Jan 31, 2020

Conversation

ashmaroli
Copy link
Member

Summary

Currently, when site.config["url"] is an empty string, :absolute_url proceeds to prepend the result from :relative_url with the empty string and then normalize the result via Addressable.

Instead, this PR proposes to return the result from :relative_url (which is already normalized via Addressable) in this scenario.

Coverage

The expected result is already covered by a test:

jekyll/test/test_filters.rb

Lines 421 to 428 in f3b4cad

should "be ok with a blank but present 'url'" do
page_url = "about/my_favorite_page/"
filter = make_filter_mock(
"url" => "",
"baseurl" => "base"
)
assert_equal "/base/#{page_url}", filter.absolute_url(page_url)
end

Copy link
Member

@mattr- mattr- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jekyllbot merge +dev

@DirtyF
Copy link
Member

DirtyF commented Jan 31, 2020

@jekyllbot: merge +dev

@jekyllbot jekyllbot merged commit 5da8271 into jekyll:master Jan 31, 2020
jekyllbot added a commit that referenced this pull request Jan 31, 2020
@ashmaroli ashmaroli deleted the empty-site-url branch January 31, 2020 17:31
@jekyll jekyll locked and limited conversation to collaborators Jan 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants