First time Hugo user, I downloaded a theme (GitHub - luizdepra/hugo-coder: A minimalist blog theme for hugo.). I was trying to use my own image as avatar. So I put my avatar into the assets/images directory, but it won’t work. In the theme, they put the image into the “static” directory, but afaik it is now recommanded to put assets such as image into the assets directory. So how can I retrieve something stored in the asset directory from hugo.toml config? I don’t know how or if it is possible to use Asset Pipe in a config file.
Whatever you put in assets, must be published somehow. Whatever you put in static, is published automatically.
“published” can be roughly interpreted as “copied to the public directory”.
If your theme doc says that you should put your avatar in static, you might follow that advice. Simply because the theme uses this code
{{ with .Site.Params.avatarURL }}
<div class="avatar"><img src="{{ . | relURL }}" alt="avatar"></div>
{{ end }}
to display the avatar image. Which will not work when you put your image in assets, as the theme doesn’t look there – it simply takes the URL you specified. And that URL will only point to a published resource.
Long story short: Just do what your theme’s do says. And read carefully about the differences between putting something in static or in assets here and in the documentation.