Hi,
I use hugo-docker “hugomods/hugo:0.147.8” in docker–compose together with hugo-book theme.
To run hugo my command line in docker-compose looks like:
server --minify --theme hugo-book -D -p 9564 --gc --cacheDir ${PRJ_TMP_DIR} -d ${PRJ_PUBLIC_DIR}/rpg-kr2-http/kr2-hugo
All works fine. I can access the service unter
http://:9564/
However, when I add the -b option to this line
http://myhost:9564/kr2-hugo/
I can not fully access hugo under http://myhost:9564/kr2-hugo, because css seems not to loaded.
In config.toml I have
RelativeURLs=true
CanonifyURLs=true
I played with different baseURL-options in config.toml without success.
Who can guide me through ?
Best regards
Thomas
See warnings:
Or to put it another way, remove those settings from your config and then troubleshoot the problem.
Thank you for the quick response. Indeed CSS is now loading after I removed this 2 lines.
However now figures are not loaded .
E.g. in my md-file I have:
{{< figure src=“/bella/bella-poc-anmeldung.png” >}}
In chrome I see
GET http://myhost:9564/bella/bella-poc-anmeldung.png 404 (Not Found)
hugo-directory shows me:
./static/bella/bella-poc-pick1.png
./public/bella/bella-poc-pick1.png
What could still the problem?
Add these lines to the bottom of your site config file:
[[module.mounts]]
source = 'assets'
target = 'assets'
[[module.mounts]]
source = 'static'
target = 'assets'
Or place global images (those you might use anywhere on the site) in the assets directory.
Reference: https://discourse.gohugo.io/t/where-to-place-image-files-when-using-the-markdown-content-format/55087
Cool, seems to work! Thank you.