Sorry to bother with this, the solution may be easy but I can’t find it.
I have this data/apps.yml
- name: app 1
description: blablabla 1
url: #1
img: img1.png
- name: app 2
description: blablabla 2
url: #2
img: img2.png
- name: app 3
description: blablabla 3
url: #3
img: img3.png
and this
{{ range $.Site.Data.apps }}
<div class="card">
<img class="card-img-top" src="{{ .Site.BaseURL }}img/{{ .img }}" alt="Card image cap">
<div class="card-body">
<h4 class="card-title">{{ .name }}</h4>
<p class="card-text">{{ .description }}</p>
<a href="{{ .url }}" class="btn btn-primary">Visit</a>
</div>
</div>
{{ end }}
but the loop doesn’t output anything, and {{ printf "%#v" $.Site.Data.apps }}
returns <nil>
.
Any idea why?