In my site had some different scheme design. So I build different configuration files for their environment. And generate the static web files with comman as below:
then got the output message from console like this :
C:\Users\senhui.li\Documents\GitRepos\hugo-next-docs>hugo -e mist -b /mist -d ./public/mist
Start building sites …
hugo v0.143.0-ee48d9692af281180aea00645d86f3231a5231df+extended windows/amd64 BuildDate=2025-02-01T15:56:04Z VendorInfo=gohugoio
WARN Relpermalink:/mist/css/main.css, Permalink:/mist/css/main.css.
WARN Add unix time end of link URL:/mist/css/main.css
WARN unixHref:/mist/css/main.css?=1738675296
WARN Add unix time end of link URL:/css/custom_style.css
WARN Add unix time end of link URL:/mist/js/main.js
WARN Add unix time end of link URL:/mist/js/clipboard.js
WARN Add unix time end of link URL:/mist/js/mermaid.js
WARN Add unix time end of link URL:/mist/js/math.js
WARN unixHref:/mist/css/main.css?=1738675298
| ZH-CN | EN-US
-------------------+-------+--------
Pages | 165 | 118
Paginator pages | 8 | 3
Non-page files | 8 | 8
Static files | 140 | 140
Processed images | 0 | 0
Aliases | 63 | 46
Cleaned | 0 | 0
Total in 3397 ms
See the debug code output message seems not problem, why there the endly generate code with double baseURL in front to css and other resource get method.
Because my website will deploy so many different domain, and then I would not write the full URL in baseURL params, only use the relative path to replace, and it can work fine in Hugo older version.
Sorry, I can’t understand this, why there endly code generate /mist/mist/css/main.css?=1738675296, not the expect code is /mist/css/main.css?=1738675296. All the relpermalink generat from resource methd were endly generat the same rule will be /mist/mist/xxxxx.
I remember that the older Hugo version would generate the right code is /mist/xxxx, but now the latest version could not same. So strange.
I also try your suggestion, but still got the error link generate like this:
hugo -e mist -b http://localhost:8080/mist/ -d ./public/mist
Start building sites …
hugo v0.143.0-ee48d9692af281180aea00645d86f3231a5231df+extended windows/amd64 BuildDate=2025-02-01T15:56:04Z VendorInfo=gohugoio
WARN Relpermalink:/mist/css/main.css, Permalink:http://localhost:8080/mist/css/main.css.
WARN Add unix time end of link URL:/mist/css/main.css
WARN unixHref:/mist/css/main.css?=1738715820
WARN Add unix time end of link URL:/css/custom_style.css
WARN Add unix time end of link URL:/mist/js/main.js
WARN Add unix time end of link URL:/mist/js/clipboard.js
WARN Add unix time end of link URL:/mist/js/mermaid.js
WARN Add unix time end of link URL:/mist/js/math.js
WARN unixHref:/mist/css/main.css?=1738715822
| ZH-CN | EN-US
-------------------+-------+--------
Pages | 165 | 118
Paginator pages | 8 | 3
Non-page files | 8 | 8
Static files | 140 | 140
Processed images | 0 | 0
Aliases | 63 | 46
Cleaned | 0 | 0
Endly result:
<link rel="stylesheet" href="http://localhost:8080/mist/mist/css/main.css?=1738715820">
<link rel="stylesheet" type="text/css" href="http://localhost:8080/mist/css/custom_style.css?=1738715820">
So sorry. That’s my mistake. when I post this problem the time I was trobule this issue in theme repo, but the replay step is complex, so forward the doc site will more easy to replay and found it.
This is a legacy configuration option, superseded by template functions and Markdown render hooks, and will likely be removed in a future release.
I strongly encourage you to disable that option. You can read more about it above, but its an imperfect, brute force approach that can affect content too. Don’t use it.
Having said that, the problem you are experiencing was unintentionally fixed in v0.143.1.
I try your suggestion and got the right result. Maybe I used it for many reasones but I can’t remember for why. And I will atten this for my develop theme work.