Open vadcx opened 2 months ago
I think you're headed in the right direction...see https://gohugo.io/functions/urls/rellangurl/
From the docs I think it should be <a href="{{ relLangURL "" }}">{{ .Site.Title | markdownify }}</a>
Are you aware of anywhere else in the code where this happens?
I am only playing with Hugo for now. I had used ripgrep on the example site but don't remember what for. If you run a site with this theme too, maybe the search pattern "/
could find all such URLs.
It seems weird to me. After finding out the above (baseurl needed to put the website in a subdirectory), I can't find many a valid use for relative URLs. Especially because they are not directory-traversal relative ../parents-subfolder/resource.png
but Hugo assumes relative ought to mean relative to root.
Some used URLs appear broken if the website is not hosted at domain root. While it won't affect most users, this ought to be a bug. Docs: https://gohugo.io/functions/urls/relurl/
Consider that hugo.toml sets the expectation of a sub-site:
Currently when built, I witness this on index.html for
header_includes.html
:header.html:
I think if I really uploaded it to a webserver's subdirectory, the CSS/JS links would've continued to work. In contrast the literal
/
root link pointing to domain root rather than baseURL:https://github.com/funkydan2/hugo-kiera/blob/dcf867345d7b5a875fc320953483db3578db97e8/layouts/partials/header.html#L19-L21
It could lead to nowhere or to a different website at domain-root/
I had thought to replace "/" with config's baseURL, but that code wants relative language URL and I've never worked with that, so I don't know if just using baseURL is appropriate here?