To enable pagination for your posts, You need to add a line to the config.yml file:

paginate: 5

The above line specifies 5 posts will be displayed per page. You could also change this number to 0 to disable pagination.

After that, just add the following code to your layout files:

{% for article in articles %}
<div class="article">
    <div><a href="{{ article.url }}">{{ article.title }}</a></div>
    <div>{{ article.content }}</div>
    <div>{% if %}{{ | date('Y-m-d H:i') }}{% endif %}</div>
{% endfor %}

<div class="pagination">
  {% if paginator.previous %}
    <span><a href="{{ paginator.urls[paginator.previous] }}">Newer Posts</a></span>
  {% endif %}
  {% if %}
    <span><a href="{{ paginator.urls[] }}">Older Posts</a></span>
  {% endif %}

And you are done.