From 4a128abf32c5614b329f9c32ede589a64642e736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Tue, 30 Jan 2024 00:21:25 +0100 Subject: [PATCH] Trying --- qsgen2 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/qsgen2 b/qsgen2 index d974a24..822b159 100755 --- a/qsgen2 +++ b/qsgen2 @@ -322,6 +322,9 @@ function _pages() { if (${debug}) echo "_pages: Running engine on ${pages_in_array}" page_content=$( ${engine} ${page_content} ) + #if (${debug}) echo "_pages: Writing page_content to disk" + #echo ${page_content} > ${project_dir}/${pages_in_array%.*}.idx + # local pages_tpl="$(<${pages})" # Replace every #pagetitle in pages_tpl @@ -344,8 +347,8 @@ function _pages() { #exit # Insert page_content into pages_tpl by replacing the BODY tag present there - if (${debug}) echo "_pages: Replacing BODY with page_content in pages_tpl" - pages_tpl=$( echo ${pages_tpl} | sed "s|BODY|${page_content}|g" ) + #if (${debug}) echo "_pages: Replacing BODY with page_content in pages_tpl" + #pages_tpl=$( echo ${pages_tpl} | sed "s|BODY|${page_content}|g" ) # Replace #updated with today's date and #version with Name and Version to footer if (${debug}) echo "_pages: _last_updated in pages_tpl" @@ -362,9 +365,12 @@ function _pages() { pages_title_lower=$( _file_to_lower "${pages_in_array}" ) # Write pages_tpl to disk echo "Writing ${www_root}/${pages_title_lower%.*}.html to disk." + tee < ${pages_tpl} | sed \ + -e "s|BODY|${page_content}|" \ + > ${www_root}/${pages_title_lower%.*}.html #echo ${pages_tpl} #exit - echo "${pages_tpl}" > ${www_root}/${pages_title_lower%.*}.html + #echo "${pages_tpl}" > ${www_root}/${pages_title_lower%.*}.html # Look for links, images and videos and convert them if present. if (${debug}) echo "_pages: Checking for #link, #showimg and #ytvideo in page_content"