krata/_includes/update-list.html

25 lines
613 B
HTML
Raw Normal View History

2020-05-09 18:28:18 +02:00
{% comment %}
2020-06-03 16:49:28 +02:00
Get the last 5 posts from lastmod list.
2020-05-09 18:28:18 +02:00
{% endcomment %}
{% assign MAX_SIZE = 5 %}
{% assign all_list = "" | split: "" %}
2020-05-09 18:28:18 +02:00
{% for post in site.posts %}
2020-11-26 16:52:59 +01:00
{% if post.last_modified_at %}
{% capture elem %}
2020-11-26 16:52:59 +01:00
{{- post.last_modified_at | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}}
{% endcapture %}
{% assign all_list = all_list | push: elem %}
{% endif %}
2020-05-09 18:28:18 +02:00
{% endfor %}
{% assign all_list = all_list | sort | reverse %}
{% assign update_list = "" | split: "" %}
{% for entry in all_list limit:MAX_SIZE %}
{% assign update_list = update_list | push: entry %}
{% endfor %}