How to write array in .md file for hugo website

Viewed 216

I'm stuck with hugo array syntax in md file.

I want to create a multidimensional array for site images that stores src and alt text.

With simple array I don't have problems

list: ["item-1", "item-2"]

But if I do something like this

list: [["scr": item-1", "alt": "alt-1"]["scr": item-2", "alt": "alt-2"]]

I have errors.

What is the right syntax for this?

1 Answers

The syntax seems to be consistent with the simple array.

list: [["scr": item-1", "alt": "alt-1"], ["scr": item-2", "alt": "alt-2"]]

You need commas between each array.

Related