<section id="article">
<h3>Recent posts</h3>
<ul>
{% for post in site.posts %}
<li>» <a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</section>
Run Code Online (Sandbox Code Playgroud)
这是我所有文章的代码,我如何控制帖子的数量,并在该部分只显示10个帖子?
Sri*_*thy 10
这是做到这一点的方法.
{% for post in site.posts offset: 0 limit: 10 %}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2180 次 |
| 最近记录: |