Here’s my simple set-up, using the Typo theme:
baseURL = "https://website.com/subfolder"
Sadly, when I then refer to either static resources or to the root folder, in the build it appears as “https://website.com/”, instead of “https://website.com/subfolder”, in things like:
<img loading="lazy" alt="{{ .Text }}" src="{{ $url }}">
<!-- markdown: ![img](/img-in-static.png) => "https://website.com/img-in-static.png
instead of https://website.com/subfolder/img-in-static.png"
!-->
Or
@font-face {
font-family: 'Literata';
src: url('/fonts/Literata/Literata-Light.woff2') format('woff2'); /* appears as "https://website.com/fonts... */
/* instead of "https://website.com/subfolder/ fonts... */ */
font-weight: light;
font-style: normal;
}
Hugo version:
hugo v0.129.0+extended darwin/arm64 BuildDate=2024-07-17T13:29:16Z VendorInfo=brew
I am browsing various posts reporting the same issues, and yet I am unable to find out what would be the easy way out of this issue? (Is it the browser that looks for the root and therefore removes the subfolder?) It’s a pain as this really is the way e.g. to create multiple sites as various repos on GitHub.
Many thanks in advance for any tips!