I have 10K+ documents, when I run hugo server -D
it warns for the images not found.
Images are referred as [](/images/medium/2VTTcgKjELIHGeRPbvTjgZ5jTWX/2VTTcgKjELIHGeRPbvTjgZ5jTWX_3.webp)
in the markdown file.
The server configuration is like
staticDir:
- "./assets"
My file location is assets -> images/rest-of-path
. Though images are rendered when server runs.
although I would consider reusing assets
folder for static
might not be a good idea as they are special stuff in Hugo and server different purposes.
with [](images/asset.png)
nothing will be rendered - assume a copy paste issue and you ment ![]
.
I’m unable to reproduce your problem: with hugo v0.125.6
hugo server --logLevel debug --printPathWarnings
sometimes removing the public
folder to get a fresh start helps.
Either a version problem or there’s more in your setup and you will have to provide more details:
FILES
hugo.yaml
baseURL: "https://localhost:1313/"
defaultContentLanguage: "en"
title: "Forum Issue-49762"
disableKinds:
- RSS
- sitemap
- taxonomy
- term
staticDir:
"./assets"
index.md
---
---
# HomePage
## Images
### LINK:
[asset1](/images/asset1.png)
### EMPTY LINK
[](/images/asset1.png)
### IMAGE

layouts/home.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>{{- or .Title site.Title -}}</title>
</head>
<body>
{{ .Content }}
</body>
</html>
FOLDERS
forum-49762
│ hugo.yml
│
├───assets
│ └───images
│ asset1.png
│
├───content
│ index.md
│
├───layouts
│ home.html
│
└───public
│ index.html
│
└───images
asset1.png
In its default configuration, Hugo doesn’t warn you about “images not found”. This warning is coming from a custom template, partial, shortcode, or render hook.
Without access to your project or theme it is impossible to know what is throwing this warning, and therefore impossible to know why.
Thanks @irkode . I tried this way. although my code ![]()
for rendering images is correct.
I suspect same. Let me separate the public/theme folder and share the temp link with you. Can you help which exactly template it would be in. Any debugger I could put. I also get warning like WARN Page 'HAHAHUGOSHORTCODE1769s179HBHB' not found in '<page_name>' not found, though its rendered.
Thanks, @jmooring, Found it. Passing custom staticDir in config doesn’t work for my custom theme, as template has passed ‘static/’ string to parse the image path for theme. I have moved it to /static
folder and it solved for me.
Thanks again.