From 1d7d18c0ac3c67c18961a074d2773a3adb6c2c5d Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Thu, 27 Jan 2022 20:03:53 +1000 Subject: [PATCH] Fix post ordering --- v2/content/posts/2020/_index.md | 1 + v2/content/posts/2021/_index.md | 1 + v2/content/posts/2022/_index.md | 6 ++++++ v2/content/posts/_index.md | 4 ++-- v2/templates/index.html | 10 ++++------ v2/templates/section.html | 7 ++----- 6 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 v2/content/posts/2022/_index.md diff --git a/v2/content/posts/2020/_index.md b/v2/content/posts/2020/_index.md index ad5f014..989b3d0 100644 --- a/v2/content/posts/2020/_index.md +++ b/v2/content/posts/2020/_index.md @@ -2,4 +2,5 @@ title = "2020" sort_by = "date" paginate_by = 5 +transparent = true +++ diff --git a/v2/content/posts/2021/_index.md b/v2/content/posts/2021/_index.md index 5645e90..d020792 100644 --- a/v2/content/posts/2021/_index.md +++ b/v2/content/posts/2021/_index.md @@ -2,4 +2,5 @@ title = "2021" sort_by = "date" paginate_by = 5 +transparent = true +++ diff --git a/v2/content/posts/2022/_index.md b/v2/content/posts/2022/_index.md new file mode 100644 index 0000000..15021b0 --- /dev/null +++ b/v2/content/posts/2022/_index.md @@ -0,0 +1,6 @@ ++++ +title = "2022" +sort_by = "date" +paginate_by = 5 +transparent = true ++++ diff --git a/v2/content/posts/_index.md b/v2/content/posts/_index.md index 20abb83..1399f88 100644 --- a/v2/content/posts/_index.md +++ b/v2/content/posts/_index.md @@ -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/). diff --git a/v2/templates/index.html b/v2/templates/index.html index 37d4a7a..78b0b89 100644 --- a/v2/templates/index.html +++ b/v2/templates/index.html @@ -21,13 +21,11 @@ {% 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 %} - {% include "article.html" %} - {% endfor %} + {% for page in section.pages | sort(attribute="date") | reverse | slice(end=10) %} + {% include "article.html" %} {% endfor %} + + View more posts →
diff --git a/v2/templates/section.html b/v2/templates/section.html index b365a80..fc2c6ba 100644 --- a/v2/templates/section.html +++ b/v2/templates/section.html @@ -22,11 +22,8 @@ {{ section.content | safe }} - {% for sub in section.subsections %} - {% set section = get_section(path=sub) %} - {% for page in section.pages %} - {% include "article.html" %} - {% endfor %} + {% for page in section.pages %} + {% include "article.html" %} {% endfor %} {% for page in paginator.pages %}