From 9635a57d1c15dc172fd832a4e6422675ed519f98 Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Sat, 14 Sep 2024 20:47:19 +0800 Subject: [PATCH] Rename template files for categories --- src/blog/categories-list.njk | 22 ---------------------- src/blog/categories.njk | 31 ++++++++++++++++--------------- src/blog/category.njk | 20 ++++++++++++++++++++ 3 files changed, 36 insertions(+), 37 deletions(-) delete mode 100644 src/blog/categories-list.njk create mode 100644 src/blog/category.njk diff --git a/src/blog/categories-list.njk b/src/blog/categories-list.njk deleted file mode 100644 index 92fd85a4..00000000 --- a/src/blog/categories-list.njk +++ /dev/null @@ -1,22 +0,0 @@ ---- -permalink: /blog/categories/ -layout: global/content -title: Blog Post Categories -tags: blog pages -blogNav: Categories -eleventyNavigation: - key: Blog Categories - title: Categories - parent: Blog - order: 2 ---- - -
See all blog posts in the archive.
\ No newline at end of file diff --git a/src/blog/categories.njk b/src/blog/categories.njk index c261ccf5..47f82d18 100644 --- a/src/blog/categories.njk +++ b/src/blog/categories.njk @@ -1,20 +1,21 @@ --- -pagination: - data: collections.categories - size: 1 - alias: category -permalink: /blog/categories/{{ category | slugify }}/ layout: global/content -eleventyComputed: - title: 'Blog Post Category: "{{ category }}"' - eleventyNavigation: - key: {{ category }} - parent: Categories +title: Blog Post Categories +tags: blog pages +blogNav: Categories +eleventyNavigation: + key: Blog Categories + title: Categories + parent: Blog + order: 2 --- -{% set postCount = collections.posts | filterByCategory(category) | length %} -See all blog posts in the archive.
\ No newline at end of file diff --git a/src/blog/category.njk b/src/blog/category.njk new file mode 100644 index 00000000..c261ccf5 --- /dev/null +++ b/src/blog/category.njk @@ -0,0 +1,20 @@ +--- +pagination: + data: collections.categories + size: 1 + alias: category +permalink: /blog/categories/{{ category | slugify }}/ +layout: global/content +eleventyComputed: + title: 'Blog Post Category: "{{ category }}"' + eleventyNavigation: + key: {{ category }} + parent: Categories +--- +{% set postCount = collections.posts | filterByCategory(category) | length %} +