From 82ce0ff99dbffb43a70c18909bcae6f0295217ff Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Wed, 17 Apr 2024 22:27:29 +0800 Subject: [PATCH] Create changelog list template --- src/_includes/main/changelog-list.njk | 9 +++++++++ src/changelogs/pages/2022.njk | 11 ++--------- 2 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 src/_includes/main/changelog-list.njk diff --git a/src/_includes/main/changelog-list.njk b/src/_includes/main/changelog-list.njk new file mode 100644 index 00000000..c79c6298 --- /dev/null +++ b/src/_includes/main/changelog-list.njk @@ -0,0 +1,9 @@ +
+ {% for log in changelogList | reverse %} +
+

{{ log.date | niceDate }}

+ +
+ {{ log.templateContent | safe }} + {%- endfor %} +
diff --git a/src/changelogs/pages/2022.njk b/src/changelogs/pages/2022.njk index 31d6eed7..a717fb15 100644 --- a/src/changelogs/pages/2022.njk +++ b/src/changelogs/pages/2022.njk @@ -8,12 +8,5 @@ metadata: date: 2022-02-02 --- -
- {% for log in collections["changelog 2022"] | reverse %} -
-

{{ log.date | niceDate }}

- -
- {{ log.templateContent | safe }} - {%- endfor %} -
+{% set changelogList = collections["changelog 2022"] %} +{% include "main/changelog-list.njk" %} \ No newline at end of file