I’m trying to use range to output a list of external links with their name and link.
I have set these as custom nested fields in the front matter, and hoped it would be the same as the {{ range .Site.Pages }}
setup, but it doesn’t.
It just concatenates all the names as one single list item, and doesn’t use the hyperlinks at all.
Here is my front matter:
featured:
- fname:
- "Forbes"
- "The New York Times"
- flink:
- "https://www.forbes.com"
- "https://www.newyorktimes.com"
And here is my layout:
<ul>
{{ range .Params.featured }}
<li>
<a href="{{.flink}}">{{.fname}}</a>
</li>
{{ end }}
</ul>
What am I doing wrong?