From 82e33fe15e262fe35763072addaf40a448f6f50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Tue, 30 Jan 2024 13:52:06 +0100 Subject: [PATCH] Working on _blog_idx_for_index --- qsgen2 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qsgen2 b/qsgen2 index cf73038..2def52e 100755 --- a/qsgen2 +++ b/qsgen2 @@ -489,8 +489,6 @@ function _blogs() { done else - - export updated_blogs=true # Declare the array to hold metadata strings for each blog BLOG_META_STR_ARRAY=() @@ -519,6 +517,7 @@ function _blogs() { # Now BLOG_META_STR_ARRAY contains the metadata string for each blog post export BLOG_META_STR_ARRAY + export updated_blogs=true fi @@ -535,6 +534,9 @@ function _blog_idx_for_index() { _blogs get_index local debug=false + +if [[ ${updated_blogs} = "true" ]]; then + local blog_list=$(<${project_dir}/templates/${theme}/blog_list.tpl) # Truncate file before writing new one @@ -570,6 +572,7 @@ function _blog_idx_for_index() { done echo ${blog_list_content} >> ${project_dir}/blog/index.tmp.html done +fi }