I have some frontmatter that looks something like this:
---
text:
- a,b,c
---
I’m attempting to unmarshal it in my template like so:
{{- $listItems := (index .Params.text 0) | transform.Unmarshal (dict "delimiter" ",") -}}
…but I get the following error:
execute of template failed: template: index.html:38:69: executing "main" at <transform.Unmarshal>: error calling Unmarshal: unknown format
If I use the value directly, it works:
{{- $listItems := "a,b,c" | transform.Unmarshal (dict "delimiter" ",") -}}
Strangely, though, the following returns true
:
{{ eq "a,b,c" (index .Params.text 0) }} → true
Is this a bug, or am I doing something wrong?
Thank you!