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

Please change the default baseURL #367

Open
frjo opened this issue Apr 15, 2024 · 2 comments
Open

Please change the default baseURL #367

frjo opened this issue Apr 15, 2024 · 2 comments

Comments

@frjo
Copy link

frjo commented Apr 15, 2024

Please change this to something like https://example.org/. In the Hugo forums we get large number of new users that get in to trouble because they keep this example setting.

baseurl = "/"

baseurl = "/"

@Vimux
Copy link
Owner

Vimux commented Apr 19, 2024

I don't see WHY replacing one with the other will make a difference. The end user can set this field correctly, not us. If not, side-effects occur in both cases. So I'd like arguments for the change.

@frjo
Copy link
Author

frjo commented Apr 19, 2024

Thanks for responding!

I think baseurl = "https://example.org/" makes it more obvious that you are supposed to change the value. If users still do not change the value it will also fail more obviously.

With baseurl = "/" the site will more or less work and users come to the forums frustrated why their site is misbehaving.

These are some of the problems you get with using baseurl = "/":

  1. The hugo server command will output Web Server is available at //localhost:1313/ (bind address 127.0.0.1) . See the schema less address for the dev server.
  2. No full URLs can be created, <link rel="canonical" href="/"> is e.g. not correct for the front page. It should be <link rel="canonical" href="https://example.org/">.
  3. When you deploy the site to be served in a sub dir, e.g. https://example.org/docs/ no resources, i.e. css/js/images/, will be loaded.
  4. Things like image in the RSS feed will have incorrect URLs.

( I have posted the same issue to a number of other popular Hugo themes.)

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

No branches or pull requests

2 participants