1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

Add hook to generate the lastmod of posts

This commit is contained in:
Cotes Chung
2020-11-19 01:58:35 +08:00
parent 1889b6b4e0
commit 10bc44367a
6 changed files with 43 additions and 57 deletions

View File

@@ -10,11 +10,13 @@
{% assign all_list = "" | split: "" %}
{% for entry in site.data.updates %}
{% capture elem %}
{{- entry.lastmod -}}::{{- entry.filename -}}
{% endcapture %}
{% assign all_list = all_list | push: elem %}
{% for post in site.posts %}
{% if post.lastmod %}
{% capture elem %}
{{- post.lastmod | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}}
{% endcapture %}
{% assign all_list = all_list | push: elem %}
{% endif %}
{% endfor %}
{% assign all_list = all_list | sort | reverse %}