diff --git a/stargem/templates/templates/gemlog.jinja b/stargem/templates/templates/gemlog.jinja index c4d59b1..7ea1475 100644 --- a/stargem/templates/templates/gemlog.jinja +++ b/stargem/templates/templates/gemlog.jinja @@ -3,7 +3,7 @@ {% if stargem.posts -%} ## Posts -{% for post in stargem.posts -%} +{% for post in (stargem.posts | sort(attribute='frontmatter.date', reverse=True)) -%} => {{ post.path }} {{ post.frontmatter.date.strftime('%F') }} {{ post.frontmatter.title }} {% endfor -%} {% endif -%} diff --git a/stargem/templates/templates/home.jinja b/stargem/templates/templates/home.jinja index 80d3db9..c2f2046 100644 --- a/stargem/templates/templates/home.jinja +++ b/stargem/templates/templates/home.jinja @@ -3,7 +3,7 @@ {% if stargem.posts -%} ## Latests Posts -{% for post in stargem.posts[:5] -%} +{% for post in (stargem.posts | sort(attribute='frontmatter.date', reverse=True))[:5] -%} => {{ post.path }} {{ post.frontmatter.date.strftime('%F') }} {{ post.frontmatter.title }} {% endfor %} {%- if stargem.posts | length > 5 %}