如何使用Zola遍历部分的帖子?

时间:2019-04-11 20:09:56

标签: rust template-engine zola tera

我尝试了以下内容,这些内容我在Zola文档中找到,但没有呈现任何内容。 Tera文档也没有得到奖励。

{% for post in section.pages %}
  <h1><a href="{{ post.permalink }}">{{ post.title }}</a></h1>
{% endfor %}

1 个答案:

答案 0 :(得分:0)

迭代节的正确方法如下:

{% for post in paginator.pages %}
  <h1><a href="{{ post.permalink }}">{{ post.title }}</a></h1>
{% endfor %}