Hello,
I was trying to join tags of my posts using delimit
like delimit .Params.tags ", "
but it was crashing with the error:
error calling delimit: can’t iterate over <nil>
After going crazy I found here an answer where, to get this this work, they said to write it like this:
{{ with .Params.tags }}{{ delimit . ", "}}{{ end }}
And… it just works! Now my doubt and question is: why it wasn’t working with just delimit .Params.tags
but it does using with
? FYI my tags are defined like this:
---
title: Something here
headline: Brief descrition
date: "2020-09-25T15:22:06+02:00"
draft: false
toc: true
tags:
- tag1
- tag2
---