Hi, I am completely new to Hugo - already love how powerful it is!
I am able to iterate over .Pages, .Title in the outer loop shown in code snippet.
However the inner loop only iterates over one section of the .Site.Data (Since I hard-coded it as .FRUITS).
<div>
{{ range .Pages }}
<div>
<div>
<h3>{{ .Title }}</h3>
</div>
<div>
{{ with .Site.Data.pricelist }}
<ul class="leaders">
{{ range .FRUITS }}
<li>
<span>{{ .item}}</span>
<span>{{ .price }}</span>
</li>
{{ end }}
</ul>
{{ end }}
</div>
</div>
{{ end }}
</div>
Instead of hard-coding .FRUITS I would like to use .Title (dynamically from the outer loop). That way the price list will rotate based on the .Title. Currently, this is how the page is rendered:
The page does not error out. However, it does not pull from the sections of the pricelist.yml file based on the .Title of the pages (from the outer range). There is no data as pictured: First Image
The desired output would look like this: Second Image
Based on data in the pricelist.yml file Third Image
I am not opposed to using the .md files; however, I am not sure how to loop over data in there Fourth image