Mainroad icon indicating copy to clipboard operation
Mainroad copied to clipboard

Please change the default baseURL

Open frjo opened this issue 1 year ago • 2 comments

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.

https://github.com/Vimux/Mainroad/blob/ed54a7cc8741349140d415943eaf1381e55507c3/exampleSite/config.toml#L1

https://github.com/Vimux/Mainroad/blob/ed54a7cc8741349140d415943eaf1381e55507c3/README.md?plain=1#L54

frjo avatar Apr 15 '24 17:04 frjo

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.

Vimux avatar Apr 19 '24 12:04 Vimux

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.)

frjo avatar Apr 19 '24 13:04 frjo