I have a data.toml that looks something like this
[person]
name = "Namer"
surname = "Namerton"
age = 99
from = "Namesville"
I then load it as data and try printing it out in the appropriate template file as something along the lines of:
{% set data = load_data(path="content/about/data.toml") %}
<table>
<tbody>
{% for k, v in data.person %}
<tr>
<th>{{ k }}</th>
<td>{{ v }}</td>
</tr>
{% endfor %}
</tbody>
</table>
But, this prints out the order of elements alphabetically based off their key value rather than in the order at which they sit in the toml file.
Only solution I’ve found is declaring a list with the order at the top and then iterating it like so:
[person]
items = ["name", "surname", "age", "from"]
...
...
{% for i in data.person.items %}
<tr>
<th>{{ i }}</th>
<td>{{ data.person[i] }}</td>
</tr>
{% endfor %}
...