Gohugo without baseurl ? or with relative url only?

it seems my thread on googlegroups has nobody attention, just wonder if it’s possible to have a no baseurl / all relative links setup?

https://groups.google.com/forum/#!topic/hugo-discuss/xsOWZUB1L-M

hi, I have a question hope somebody here can help:

All the docs seems requiring a baseurl to be set, but actually I don’t
want that, wonder is there an option to use relative URLs only?
https://gohugo.io/overview/configuration/l

Because I want to publish the same set of static html files to
multiple sites under different domains / url path, when generate html
with relative only urls, it also works better to browse with a local
protocol like “file://path/to/generated/html-files/”

Can GoHugo support a relative url only mode?

Thanks,

1 Like
<!--config.toml-->
baseurl = ""

1 Like

To browse via file system you also need to set

relativeurls = true

I think this is documented, and is a little hidden gem in Hugo …

3 Likes

Another useful setting to use is:
uglyurls = true

because your posts located in (example): 2019/posts/ will just load the folder, and not the index.html located in that folder like a regular server would do.

1 Like