.Resources

I’m struggling with a simple example. Trying to access .Resources, as in the example here

{{ .Resources.Match "images/*" }}

Error I get is:
e[?25lBuilding sites … ERROR 2018/04/28 21:59:44 error processing shortcode “shortcodes/listImages.html” for page “test\_index.md”: template: shortcodes/listImages.html:1:13: executing “shortcodes/listImages.html” at <.Resources.Match>: can’t evaluate field Resources in type *hugolib.ShortcodeWithPage
e[KTotal in 105 ms
Error: Error building site: logged 1 error(s)

Hugo Static Site Generator v0.40.1 windows/amd64 BuildDate: 2018-04-25T13:21:16Z

Try:

{{ .Page.Resources.Match “images/*” }}

2 Likes

2 posts were split to a new topic: Difference between .Resources, .Page.Resources, $.Page.Resources