Hi,
Sincere apologies if this has been asked/answered (it probably has since its a basic question), but I have been struggling with finding a solution for it for a couple of days.
The basic question: What is the best way to access parameters set in frontmatter from a template/partial? (e.g., .Params.param_name). i.e., how do you get the partial to find the variables associated with the page it is called from?
My specific case is with regard to a carousel template (Slider/Carousel | Hugo Codex). It accesses the image arguments from site data:
{{ range $index, $slide := .context.Site.Data.carousel.images }}
a yaml file called ‘carousel’ and the type ‘images’ within this file.
However, I would like to have it so that it will use images associated with a particular project so that it can be called on multiple pages with different sets of images. I’ve been trying to set the images in the frontmatter for the project page, but .Params.images (for example) doesn’t seem to find the page parameter.
Any help would be much appreciated! I’m still new to Hugo