Hi!
I played a bit with Zola and Tera (both wonderful, btw) and I was wondering if there was a more efficient way to add a separator between TOML arrays once they are rendered.
An example would be tags, given this array
tags = [
"Tag1",
"Tag2",
"Tag3"
]
having them rendered like:
Tag1, Tag2, Tag3
For now, I am using the following solution (add a comma to every element of the loop, avoid if it is the last):
{% for tag in page.extra.tags %}
{% if not loop.last %}
<a href="" class="pub-tag">{{ tag }},</a>
{% elif loop.last %}
<a href="" class="pub-tag">{{ tag }}</a>
{% endif %}
{% endfor %}
But I wonder if I am missing something and if there is a more efficent way of doing it.
Thanks in advance!