From ab60cbea2faafc99ef82225a9afb314dec3c2f18 Mon Sep 17 00:00:00 2001 From: Leilukin Date: Wed, 17 Apr 2024 23:52:11 +0800 Subject: [PATCH] Check if the page has any tags before looking for specific tag --- src/_includes/main/article.njk | 2 +- src/_includes/main/content.njk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_includes/main/article.njk b/src/_includes/main/article.njk index 27b1d806..10ccf61e 100644 --- a/src/_includes/main/article.njk +++ b/src/_includes/main/article.njk @@ -24,7 +24,7 @@ metadata: {{ content | safe }} - {% if tags.includes("posts") %} + {% if tags and tags.includes("posts") %} {% include "blog/blognav.njk" %} {% endif %} \ No newline at end of file diff --git a/src/_includes/main/content.njk b/src/_includes/main/content.njk index 3c254273..1a4d5fd2 100644 --- a/src/_includes/main/content.njk +++ b/src/_includes/main/content.njk @@ -18,7 +18,7 @@ layout: main/base {{ content | safe }} - {% if tags.includes("blog pages") %} + {% if tags and tags.includes("blog pages") %} {% include "blog/blognav.njk" %} {% endif %} \ No newline at end of file