Fix sorting in default templates
This commit is contained in:
parent
7383b8f05b
commit
c0d63caf1a
2 changed files with 2 additions and 2 deletions
|
@ -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 -%}
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in a new issue