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

invalid BaseURL when it is not set #7044

Closed
prashant-shahi opened this issue Mar 11, 2020 · 2 comments
Closed

invalid BaseURL when it is not set #7044

prashant-shahi opened this issue Mar 11, 2020 · 2 comments

Comments

@prashant-shahi
Copy link

@prashant-shahi prashant-shahi commented Mar 11, 2020

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

$ hugo version
Hugo Static Site Generator v0.63.2-934EE21F linux/amd64 BuildDate: 2020-01-27T12:13:19Z

How to reproduce

For v0.58, when I don't set any Base URL, the .Site.BaseURL variable returns blank.

For the v0.63, let's say for a domain https://abcd-1234.surge.sh when I don't set any Base URL, the .Site.BaseURL variable returns https://abcd-1234.

I believe that it should return either blank or the complete URL https://abc-1234.surge.sh.
Do let me know if this is intended.

@bep

This comment has been minimized.

Copy link
Member

@bep bep commented Mar 11, 2020

The baseURL should be a valid URL with protocol and all, e.g. https://example.org. Neither of your examples matches that. We should consider adding some validation to this, but that would break many sites in the wild using / etc.

@bep bep closed this Mar 11, 2020
@prashant-shahi

This comment has been minimized.

Copy link
Author

@prashant-shahi prashant-shahi commented Mar 11, 2020

My bad. Now, I have edited the PR description to include https as well. This clearly looks like a bug to me as the same code worked well for Hugo v0.58.

Edit:
Turns out there was a mistake on my end.

@bep Thanks for spending time in looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.