如何控制我最近的Jekyll帖子?

use*_*733 3 jekyll

  <section id="article">
  <h3>Recent posts</h3>
<ul>
    {% for post in site.posts %}
      <li>&raquo; <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)