Fix post ordering

This commit is contained in:
Wesley Moore 2022-01-27 20:03:53 +10:00
parent 3bcc719e6a
commit 1d7d18c0ac
No known key found for this signature in database
GPG key ID: BF67766C0BC2D0EE
6 changed files with 16 additions and 13 deletions

View file

@ -2,4 +2,5 @@
title = "2020"
sort_by = "date"
paginate_by = 5
transparent = true
+++

View file

@ -2,4 +2,5 @@
title = "2021"
sort_by = "date"
paginate_by = 5
transparent = true
+++

View file

@ -0,0 +1,6 @@
+++
title = "2022"
sort_by = "date"
paginate_by = 5
transparent = true
+++

View file

@ -1,8 +1,8 @@
+++
title = "Posts"
sort_by = "date"
paginate_by = 5
paginate_by = 50 # TODO: add the page links to the section template
+++
Looking for posts made before 2020?
**Looking for posts made before 2020?**
Check out the [previous version of my website](https://www.wezm.net/articles/).

View file

@ -21,13 +21,11 @@
</h2>
{% set section = get_section(path="posts/_index.md") %}
{% set subsections = section.subsections | reverse %}
{% for sub in subsections %}
{% set section = get_section(path=sub) %}
{% for page in section.pages %}
{% for page in section.pages | sort(attribute="date") | reverse | slice(end=10) %}
{% include "article.html" %}
{% endfor %}
{% endfor %}
<a href="{{ config.base_url }}/posts/">View more posts →</a>
</section>
<section class="projects-section">

View file

@ -22,12 +22,9 @@
{{ section.content | safe }}
{% for sub in section.subsections %}
{% set section = get_section(path=sub) %}
{% for page in section.pages %}
{% include "article.html" %}
{% endfor %}
{% endfor %}
{% for page in paginator.pages %}
{% include "article.html" %}