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

relURL is stripping the baseURL path #10049

Closed
mattcone opened this issue Jun 24, 2022 · 3 comments
Closed

relURL is stripping the baseURL path #10049

mattcone opened this issue Jun 24, 2022 · 3 comments

Comments

@mattcone
Copy link

Hey there! I believe we're experiencing a bug that is possibly related to #9994 and #10002. Someone actually left a couple comments related to this that I think accurately describe the bug:

Prior to v101, we had this set up and it was working:

baseURL = "https://example.com/foo"

{{ "/images/logo.svg" | relURL }}

http://localhost:1313/foo/images/logo.svg

Now, after the upgrade to v101, we see this:

baseURL = "https://example.com/foo"

{{ "/images/logo.svg" | relURL }}

http://localhost:1313/images/logo.svg

The foo part of baseURL is being stripped out by relURL.

What version of Hugo are you using (hugo version)?

hugo v0.101.0+extended darwin/amd64 BuildDate=unknown

Does this issue reproduce with the latest release?

Yes 😄

@bep
Copy link
Member

bep commented Jun 24, 2022

{{ "/images/logo.svg" | relURL }}

http://localhost:1313/foo/images/logo.svg

This was a bug fix in 101 making relURL work the same as absURL.

The gist of it is, res starting with a / is considered relative to the server host, remove that and it will work. Your breakage is unfortunate, but it was wrong before.

@bep bep closed this as completed Jun 24, 2022
@mattcone
Copy link
Author

Thanks for the additional information.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants