Hi all, I’m new to Zola but have experience with Twig and Hugo. Having a very embarrassing problem: I’m trying to loop over every page in Tera and sort them by weight, but I get an error. My code:
{% for page in pages|sort(attribute="weight") %}
{# print page #}
{% endfor %}
I’m not sure what I’m doing wrong, and I couldn’t find any documentation that provided any more insight.
Oh interesting, thanks for the reply. This will actually solve my current use case, but out of curiosity, is there a way to print pages with multiple sorts inside the same section?
For instance, say I’m using weighted sort plus another condition to print menu items (e.g. menu = true), and then in that same section print date sorted article pages in the main content.