To start, in data/products, I have product.toml with the a map for color values like this:
[color]
[[color.logo]]
name = "blue"
cid = "blue"
images = "http://placehold.it/330x508"
[[color.logo]]
name = "Green"
cid = "green"
images ="http://placehold.it/330x508"
[[color.product]]
name = "Black"
cid = "black"
images = ""
In my product.html, I’m trying to get the colors listed with a delimiter ("|"). I read something about not being able to delimit range output, which I can confirm that I did not get working so I switched to this:
{{ $lc := .Site.Data.products.color.logo }}
{{ if isset $lc .cid }}
{{ delimit (index $lc .cid) "|" }}
{{ end }}
That keeps returning a blank.
Any ideas what I’m missing, or how I can get this to work?
Also, is it possible to have/manipulate an array as one of the key, value pairs in the map? That’s my next thing to tackle
example:
[color]
[[color.logo]]
images = ["image1","image2"]