Page.Resources is always empty

I’m trying to have a series of posts each one with a different featured image and thought the Page Resources would be a nice way to do that, but I can’t get that to work.

I add the resources correctly in the post’s front matter but .Resources inside the template is always nil, though .Params.resources shows the data correctly.

I’ve made a minimal test project showing what I’m trying to do, there’s a single post and its related featured image fall.jpg and a custom layout in layouts/_default/single.html.

hugo server returns no errors.

git clone && cd hugo-testing-resources && git submodule init and you’re ready to go.

$ hugo env
Hugo Static Site Generator v0.53/extended linux/amd64 BuildDate: unknown


You need to turn your into a page bundle:

Then put the related featured image inside the bundle.

1 Like

Thanks, it worked.