feat: sorted home recipe list by updated at time
This commit is contained in:
parent
928e7aecff
commit
e46d2b8d38
2 changed files with 39 additions and 1 deletions
|
|
@ -36,9 +36,10 @@ description: Welcome to my website! I write about tech, politics, food, and hobb
|
|||
{% set recipesList = [] %}
|
||||
{% for slug, recipeData in collections.recipesBySlug %}
|
||||
{% if recipeData.newest %}
|
||||
{% set recipesList = recipesList.concat([{slug: slug, data: recipeData}]) %}
|
||||
{% set recipesList = recipesList.concat([{slug: slug, data: recipeData, updatedAt: recipeData.newest.data.updatedAt}]) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% set recipesList = recipesList | sort(false, false, 'updatedAt') | reverse %}
|
||||
|
||||
{% if recipesList.length > 0 %}
|
||||
<div class="section-header">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue