Caution: this post was published in 2019 and may contain information, techniques or code examples that are no longer current. Please double-check official documentation and modern best practices before using anything from this article.

Jekyll uses the Liquid templating language to process templates. This post provides a basic example to show the five latest blog posts and highlight the first post.

{% for post in site.posts limit:1 %}

  <h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
  {{ post.content | strip_html | truncatehtml | truncatewords: 40 }}

{% endfor %}

{% for post in site.posts offset:1 limit:4 %}

  <h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
  {{ post.content | strip_html | truncatehtml | truncatewords: 20 }}

{% endfor %}

The code consists of two loops, the first loop shows one post (the newest one) the second post shows the next four posts.