i have an YAML file (articles.yaml) like this:
article1
name: art1
weight: "12"
form: round
article2
name: art2
weight: "12"
form: round
article3
name: art3
weight: "12"
form: rectangle
article4
name: art4
weight: "12"
form: rectangle
And i want to output just the form, but not duplicated.
{{ range $.Site.Data.articles }}
- {{ .form | uniq }}
{{ end }}
Output:
- round
- rectangle
I understand that uniq doesnt work on strings. But what is the workaround for that problem?