From 816f23db3d30bd8959805fee05dda46e3e704258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Wed, 31 Jan 2024 20:32:46 +0100 Subject: [PATCH] _pages: Add variable new_updated_pages=true/false and use it in _sitemap --- qsgen2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qsgen2 b/qsgen2 index b198dee..73e800d 100755 --- a/qsgen2 +++ b/qsgen2 @@ -423,9 +423,12 @@ function _pages() { done + export new_updated_pages=true + else _msg info "No new or updated Pages" + export new_updated_pages=false fi @@ -621,7 +624,8 @@ function _blog_index() { function _sitemap() { -if [[ ${sitemap} == "true" ]]; then +# Check if sitemap is set to true and if there are updated Blogs or Pages before updating the sitemap.xml file. +if [[ ${sitemap} == "true" ]] && ( [[ ${new_updated_blogs} == "true" ]] || [[ ${new_updated_pages} == "true" ]] ); then _msg info "Generating sitemap.xml"