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 -%}
|
{% 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 -%}
|
||||||
|
|
|
@ -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 %}
|
||||||
|
|
Loading…
Reference in a new issue