Menu and pagination urls are malformed when baseurl is of the form



baseurl = ""
  name = "About"
  title = "About"
  url = "/about/"

Expected url for about menu item:
But got:

Similarly, the pagination no. links also insert redundant blog in url.

What am I missing?

To be more clear, clicking on the menu item “About” takes user to while expected valid link is

I’m not sure what the answer is, but here’s a few things to try which may point you in the right direction.

  1. The Story theme uses .URL to build the Menu. This is deprecated in the latest versions of Hugo. You might like to raise an issue on the theme and ask the developer to update the theme to work with Hugo > 0.55, or fork it yourself.
  2. Try setting relativeURLS=false in your config.toml file, and then define urls like /blog/about/ for your menu??
  3. I’ve seen some threads here where setting baseURL = "/" and having relativeURLS=false (I think) seems to work where a site is hosted in a subdirectory.

Thanks! Somebody has already opened a PR for the same.

I solved it using my custom subdomain for baseurl. Oh and yes, I originally forgot to state that I have relativeURLs = true and I don’t want to change it.

Now, it works for but not for The image on takes the path instead of

Is it possible to retain relativeURLs = true and make hugo site to serve correctly at as well as on ?

Alright, so I finally fixed it using relative path for the image and now I can browse website at both the urls without any issue.

But now, I’m wondering what changes/precautions one needs to take to make hugo website available at and without losing relativeURLs = true.

Closing this issue and filling a new one for the same.