Hi there,
I have a portfolio single template, that would like to render the first 4 related portfolio with the first value of the industry which is health
.
Given inside:
# content/works/work-1.md
industry: ["health", "lifestyle"]
# content/works/work-2.md
industry: ["health", "food"]
# content/works/work-3.md
industry: ["health", "retail"]
# content/works/work-4.md
industry: ["health"]
HTML inside layouts/work/single.html
:
<div class="stories-list masonry stories-new">
{{$industryCat := index (.Site.Params.industry) 0 }}
{{ range first 4 (where .Site.RegularPages "Section" "works") $industryCat }}
<div class="story-item grid-item blue">
<div class="img">
<img src="uploads/img29.jpg" alt="image description">
</div>
<h3><a href="#">Title</a></h3>
<p><a href="#">Description</a></p>
<ul class="categories">
<li><a href="#">Health</a></li>
</ul>
</div>
{{ end }}
</div>
Thank you