From b475c5767f291049a8bf18747d71b320f75aa731 Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Thu, 18 Apr 2024 02:08:32 +0800 Subject: [PATCH] Set content index navigation --- src/_includes/blog/blognav.njk | 17 --------------- src/_includes/main/article.njk | 4 ++-- src/_includes/{blog => main}/blogpost.njk | 0 src/_includes/main/content-nav.njk | 25 +++++++++++++++++++++++ src/_includes/main/content.njk | 4 ++-- src/blog/posts.njk | 2 ++ src/blog/posts/posts.11tydata.json | 2 +- src/pages/blog.njk | 2 +- 8 files changed, 33 insertions(+), 23 deletions(-) delete mode 100644 src/_includes/blog/blognav.njk rename src/_includes/{blog => main}/blogpost.njk (100%) create mode 100644 src/_includes/main/content-nav.njk diff --git a/src/_includes/blog/blognav.njk b/src/_includes/blog/blognav.njk deleted file mode 100644 index e8c394d3..00000000 --- a/src/_includes/blog/blognav.njk +++ /dev/null @@ -1,17 +0,0 @@ - - - \ No newline at end of file diff --git a/src/_includes/main/article.njk b/src/_includes/main/article.njk index 0e633b84..173faa23 100644 --- a/src/_includes/main/article.njk +++ b/src/_includes/main/article.njk @@ -31,7 +31,7 @@ metadata: {{ content | safe }} - {% if tags and tags.includes("posts") %} - {% include "blog/blognav.njk" %} + {% if tags and tags.includes("articles") or tags and tags.includes("posts") %} + {% include "main/content-nav.njk" %} {% endif %} \ No newline at end of file diff --git a/src/_includes/blog/blogpost.njk b/src/_includes/main/blogpost.njk similarity index 100% rename from src/_includes/blog/blogpost.njk rename to src/_includes/main/blogpost.njk diff --git a/src/_includes/main/content-nav.njk b/src/_includes/main/content-nav.njk new file mode 100644 index 00000000..50ffdf95 --- /dev/null +++ b/src/_includes/main/content-nav.njk @@ -0,0 +1,25 @@ + + + \ No newline at end of file diff --git a/src/_includes/main/content.njk b/src/_includes/main/content.njk index 1a4d5fd2..ae9d806c 100644 --- a/src/_includes/main/content.njk +++ b/src/_includes/main/content.njk @@ -18,7 +18,7 @@ layout: main/base {{ content | safe }} - {% if tags and tags.includes("blog pages") %} - {% include "blog/blognav.njk" %} + {% if title === "Articles" or tags and tags.includes("blog pages") %} + {% include "main/content-nav.njk" %} {% endif %} \ No newline at end of file diff --git a/src/blog/posts.njk b/src/blog/posts.njk index 9db91f46..f6be9899 100644 --- a/src/blog/posts.njk +++ b/src/blog/posts.njk @@ -7,6 +7,8 @@ pagination: title: Blog Archive layout: main/content tags: blog pages +eleventyComputed: + desc: Archive of blog posts on {{ sitemeta.siteName | safe }} ---