From ececfbcb59647b29f797a6c5c7df5aa17824ce38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Fri, 2 Feb 2024 10:55:39 +0100 Subject: [PATCH] _pages: Rearrange some stuff --- qsgen2 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/qsgen2 b/qsgen2 index b3926dc..2212d7e 100755 --- a/qsgen2 +++ b/qsgen2 @@ -417,11 +417,6 @@ function _pages() { if (${debug}) _msg debug "_pages: Running engine on ${pages_in_array}" if [[ ${file_ext} == "tpl" ]]; then local page_content=$( ${engine} "$page_content" ) - elif [[ ${file_ext} == "md" ]]; then - local page_content=$(echo "$page_content" | ${engine}) - #echo "$page_content" - #exit - fi # Look for links, images and videos and convert them if present. if (${debug}) _msg debug "_pages: Checking for #link, #showimg and #ytvideo in page_content" @@ -437,9 +432,14 @@ function _pages() { if (${debug}) _msg debug "_pages: #ytvideo is present, run _youtube: page_content" local page_content=$( _youtube "${page_content}" ) fi + elif [[ ${file_ext} == "md" ]]; then + local page_content=$(echo "$page_content" | ${engine}) + #echo "$page_content" + #exit + fi # Let's find the file 'index.tpl' and add the blog if blog_in_index is true - if [[ ${pages_in_array} == "index.tpl" ]] && [[ ${blog_in_index} == "true" ]]; then + if [[ ${pages_in_array} == "index.${file_ext}" ]] && [[ ${blog_in_index} == "true" ]]; then if (${debug}) _msg debug "_pages: Inserting blog list to index.html" local blog_index_list=$(<${project_dir}/blog/index.tmp.html) echo ${blog_index_list} >> ${page_content} @@ -448,7 +448,7 @@ function _pages() { # Insert page_content into pages_tpl by replacing the BODY tag present there if (${debug}) _msg debug "_pages: Replacing BODY with page_content in pages_tpl using Perl" # Use Perl for multi-line and special character handling - local pages_tpl=$( echo "${pages_tpl}" | sed -e "s|BODY|\"${page_content}\"|" ) + local pages_tpl=$( echo "${pages_tpl}" | sed -e "s|BODY|${page_content}|" ) # Replace every #pagetitle in pages_tpl if (${debug}) _msg debug "_pages: Replacing #pagetitle in pages_tpl"