如何使用Zola迭代某个部分的帖子?

问题描述 投票:0回答:1

我尝试了以下内容,我在Zola文档中找到了它,但它没有呈现任何内容。 Tera文档也没有回报。

{% for post in section.pages %}
  <h1><a href="{{ post.permalink }}">{{ post.title }}</a></h1>
{% endfor %}
rust template-engine zola tera
1个回答
0
投票

迭代部分帖子的正确方法如下:

{% for post in paginator.pages %}
  <h1><a href="{{ post.permalink }}">{{ post.title }}</a></h1>
{% endfor %}
© www.soinside.com 2019 - 2024. All rights reserved.