From 82b47acc07853e1b4718404f0ef0c309862ef3a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Wed, 31 Jan 2024 07:19:17 +0100 Subject: [PATCH] Update _blog_index and rename _generate_sitemap to _sitemap --- qsgen2 | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/qsgen2 b/qsgen2 index 7883c63..e67fae7 100755 --- a/qsgen2 +++ b/qsgen2 @@ -580,19 +580,19 @@ function _blog_idx_for_index() { } function _blog_index() { + echo "_blog_index: blog_in_index = ${blog_in_index}" # This function generates the /blog/index.html file that gets its data from _blog_list_for_index() - - local debug=false - local blog_index_file=${project_dir}/themes/${theme}/blog_index.tpl - local blog_index=$(<${blog_index_file}) - local blog_index_list=$(<${project_dir}/blog/index.tmp.html) + if [[ ${blog_in_index} == "false" ]]; then + local debug=false + local blog_index_file=${project_dir}/themes/${theme}/blog_index.tpl + local blog_index=$(<${blog_index_file}) + local blog_index_list=$(<${project_dir}/blog/index.tmp.html) + + if [[ ! -f ${blog_index_file} ]]; then + echo "Unable to find the Blogs template: ${blog_index_file}" + exit + fi - if [[ ! -f ${blog_index_file} ]]; then - echo "Unable to find the Blogs template: ${blog_index_file}" - exit - fi - - if [[ ${blog_in_index} == "false" ]]; then echo "${green}Updating the Blog Index file${end}" blog_index_content=$(echo "${blog_index}" | perl -pe "s|BODY|${blog_index_list}|g") echo ${blog_index_content} > ${www_root}/blog/index.html @@ -603,7 +603,7 @@ function _blog_index() { } -function _generate_sitemap() { +function _sitemap() { echo "${bold_yellow}Generating sitemap.xml${end}" @@ -825,4 +825,5 @@ echo "3. ${green}Running function _blog_index" _blog_index echo "4. ${green}Running function _pages${end}" _pages -_generate_sitemap \ No newline at end of file +echo "4. ${green}Running function _sitemap${end}" +_sitemap \ No newline at end of file