How to display array as listed in .md with range

Hi,

New to hugo here and I’m struggling with displaying data correctly.

I understand that {{ range }} displays items in alphabetical order or reverse alphabetical order.

But I want it to display as it appears in the array.

Here is my example.md in my content folder

title = "example"
description = "example"
date = "2014-09-27"
type = "page"
layout = "example"
slug = "example"
[exampleArr]
	foo = ["asdf", "qwerty"]
	bar = ["lorem", "ipsum"]
	pewpew = ["hugo", "is cool"]

When I use {{ range $key, $param := .Params.exampleArr }}

it returns the order as: bar , foo , pewpew but I need it to display as foo , bar , pew pew

Help would be awesome!

Your exampleArr isn’t an array or slice, it is a map (dictionary). The iteration order of keys are not guaranteed (since Go 1.1). You may have some luck with sorting or use another TOML collection. Not sure.

Hi bep, shots for the response.

So would you recommend creating a new .md file storing all the relevant information or create taxonomy terms?