Skip to content

sorting by frontmatter integers #2158

Answered by pdehaan
ahillio asked this question in Q&A
Jan 7, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

@ahillio I think you're missing a | before the sortByOrder filter.
This worked for me (using Nunjucks template engine):

{%- for post in collections.oikos | sortByOrder -%}
  {{ post.data.title }} ({{ post.data.order }})
{% endfor %}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@pdehaan
Comment options

pdehaan Jan 7, 2022
Collaborator

@ahillio
Comment options

Answer selected by ahillio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants