From c5072c005a63693b11a3d8aa358cf4ca9a1ba125 Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Sun, 15 Sep 2024 10:17:26 +0800 Subject: [PATCH] Create Nunjucks macro for site feed link --- src/_includes/global/macros.njk | 25 +++++++++++++++---------- src/_includes/main/changelogs.njk | 3 ++- src/_includes/main/footer.njk | 3 ++- src/assets/css/utility.css | 2 ++ src/index.njk | 3 ++- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/_includes/global/macros.njk b/src/_includes/global/macros.njk index d9a1377f..a37f146c 100644 --- a/src/_includes/global/macros.njk +++ b/src/_includes/global/macros.njk @@ -1,13 +1,18 @@ {%- macro modEntry(params) -%} - ### {{ params.title }} -
{{ params.desc }}
-{{ params.desc }}
+To get notified of the updates on this website, you can subscribe to the {{ sitemeta.siteName }} RSS feed, which contains new articles, blog posts and website changelogs.
+{% from "global/macros.njk" import siteFeedLink %} +To get notified of the updates on this website, you can subscribe to its {{ siteFeedLink("RSS feed") }}, which contains new articles, blog posts and website changelogs.
{{ content | safe }} diff --git a/src/_includes/main/footer.njk b/src/_includes/main/footer.njk index 015b39cd..1a710d64 100644 --- a/src/_includes/main/footer.njk +++ b/src/_includes/main/footer.njk @@ -3,8 +3,9 @@ {% block footerContent %}You can subscribe to the {{ sitemeta.siteName }} RSS feed to get notified of the updates on this website, including new articles, blog posts and website changelogs.
+ {% from "global/macros.njk" import siteFeedLink %} +You can subscribe to the {{ siteFeedLink(sitemeta.siteName + " RSS feed") }} to get notified of the updates on this website, including new articles, blog posts and website changelogs.
{% include "main/statuscafe.njk" %}