<!-- Get 5 last posted/updated posts -->

{% assign MAX_SIZE = 5 %}

{% assign all_list = '' | split: '' %}

{% for post in site.posts %}
  {% assign datetime = post.last_modified_at | default: post.date %}

  {% capture elem %}
    {{- datetime | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}}
  {% endcapture %}

  {% assign all_list = all_list | push: elem %}
{% endfor %}

{% assign all_list = all_list | sort | reverse %}

{% assign update_list = '' | split: '' %}

{% for entry in all_list limit: MAX_SIZ