Fix sorting in default templates

This commit is contained in:
Erick Ruiz de Chavez 2025-01-12 10:11:37 -05:00
parent 7383b8f05b
commit c0d63caf1a
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@
{% if stargem.posts -%} {% if stargem.posts -%}
## 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 }} => {{ post.path }} {{ post.frontmatter.date.strftime('%F') }} {{ post.frontmatter.title }}
{% endfor -%} {% endfor -%}
{% endif -%} {% endif -%}

View file

@ -3,7 +3,7 @@
{% if stargem.posts -%} {% if stargem.posts -%}
## Latests 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 }} => {{ post.path }} {{ post.frontmatter.date.strftime('%F') }} {{ post.frontmatter.title }}
{% endfor %} {% endfor %}
{%- if stargem.posts | length > 5 %} {%- if stargem.posts | length > 5 %}