how do I call the .Param function from inside a render hook ?
It says
/home/drm/WEBSITE/themes/hugo-book/layouts/_default/_markup/render-image.html:28:16": execute of template failed: template: _default/_markup/render-image.html:28:16: executing “_default/_markup/render-image.html” at <$.Param>: can’t evaluate field Param in type goldmark.imageLinkContext
/home/drm/WEBSITE/themes/hugo-book/layouts/_default/_markup/render-image.html:28:16": execute of template failed: template: _default/_markup/render-image.html:28:16: executing “_default/_markup/render-image.html” at <$.Param>: can’t evaluate field Param in type goldmark.imageLinkContext
Built in 217 ms
I know your code should work, but it doesn’t. This is the very beginning of my image renderhook, in themes/hugo-book/layouts/_default/_markup/render-image.html:
Why shouldn’t it start with $ ? I thought using .Page would call on the frontmatter parameter only ? If it’s some context/syntax shenaningan, I suggest warmly adding a warning in .Param | Hugotoo, because users who want to get things done are likely to find this kind of thing tedious at best.
Copy and paste the [params] section from your site configuration.
Copy and paste the front matter from the page that is giving you problems.
The only way you get <nil> from the construct above is if the image size is larger than 100000, and .Page.Param can’t find the value in either front matter or in the site config.