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

absolute_url should complain if URL is not absolute #5718

Closed
pathawks opened this issue Jan 5, 2017 · 4 comments
Closed

absolute_url should complain if URL is not absolute #5718

pathawks opened this issue Jan 5, 2017 · 4 comments
Assignees
Labels
frozen-due-to-age has-pull-request Somebody suggested a solution to fix this issue

Comments

@pathawks
Copy link
Member

pathawks commented Jan 5, 2017

If site.url == example.org, then {{ "/" | absolute_url }} will return example.org/.

If the current page (https://example.org/about/) includes a link to the above URL, visiting that link will direct the browser to https://example.org/about/example.org/.

This is obviously not the intended behavior.

Now that jekyll-sitemap and jekyll-feed are relying on these filters, a site.url that does not contain a protocol can bork a site's entire sitemap or feed.

I don't know if this is best fixed with jekyll doctor or by complaining at build time.

@pathawks pathawks self-assigned this Jan 5, 2017
@parkr
Copy link
Member

parkr commented Feb 11, 2017

Duplicate of #5788?

@pathawks
Copy link
Member Author

pathawks commented Feb 11, 2017

Duplicate of #5788?

No. Kind of the opposite.

In this case, if site.url is not absolute, then the absolute_url filter will never work: it will never generate an absolute URL.

Edit: But I guess it is the problem I am trying to fix in #5760

@pathawks pathawks added the has-pull-request Somebody suggested a solution to fix this issue label Feb 11, 2017
@ashmaroli
Copy link
Member

@pathawks the PR linked to this ticket has been merged. Is this still an issue?

@pathawks
Copy link
Member Author

pathawks commented Aug 3, 2017

@ashmaroli Good catch 👍

@pathawks pathawks closed this as completed Aug 3, 2017
@jekyll jekyll locked and limited conversation to collaborators Jul 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age has-pull-request Somebody suggested a solution to fix this issue
Projects
None yet
Development

No branches or pull requests

4 participants