Welcome to the forum. I’ll give my educated guesses, cause your posted snippet on it’s own lacks information to pin that down exactly. see Requesting Help
involved templates:
-
baseof.html - pass the context (the DOT)
{{ block "main" . }}{{ end }} -
your template: the snippet works if
- it can be found by the lookup rules → actually executed
- you pass the context (dot from above) which is referenced via
$.Site - the data structure matches your loop logic
/data/fridge.yamlshould look like:- message: Mess 1 name: Name 1 - message: Mess2 name: Name 2
Hints:
- check the generated html pages in
/public/...to see if anything is generated - use
{{ warnf "hello" }}to debug (processing info in console)
if you can’t spot it → Show your code and Hugo version, env
p.s. consider this - not a cause for your problem right now
site.Data is deprecated since (v0.156.0) change $.Site.fridge to:
- 156+ :
hugo.Data.fridge - older versons: i would use
site.Data.fridgewhich eleminates context problems