How do I sort a map by default order?

By default order, I mean the order as specified in front matter. In this case: title followed by price.

Using your code, you get the following:

price : 12 title : Dog
price : 20 title : Ape
price : 32 title : Cat

Which is not what I’m after, as the order is incorrect: price, then title.

My use case is that I’m creating a table, and the headings are title, then price. By using your code, or my original one, you get the wrong order.

Not sure if it’s linked to this.