From 7ce545e423423724cad13120cc864650fc2fca6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Mon, 12 Feb 2024 21:04:16 +0100 Subject: [PATCH] Add blog index content to /blog/index.html This commit adds the blog index content to the file /blog/index.html. The function replaces the placeholder in the content with the actual blog index list. After the replacement, the updated content is written to the file /blog/index.html. The commit also includes debug messages to display the content of before writing it to the file. --- qsgen2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qsgen2 b/qsgen2 index bf79fb0..db7c00a 100755 --- a/qsgen2 +++ b/qsgen2 @@ -914,6 +914,11 @@ function _blog_index() { if (${debug}) _msg debug "_blog_index: Replacing BODY with content of ${project_dir}/blog/index.tmp.html" blog_index_content=$( awk -v new_body="$blog_index_list" '{sub(/BODY/, new_body)} 1' <(echo "${blog_index_content}") ) + if (${debug}); then + _msg debug "_blog_index: Writing ${www_root}/blog/index.html" + _msg debug "_blog_index: Content of blog_index_content" + _msg info "${blog_index_content}" + fi echo "${blog_index_content}" > ${www_root}/blog/index.html _f_last_updated ${www_root}/blog/index.html fi