From 7b33a0fc110460a6d80d1189eec07cfb58fbee73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Mon, 29 Jan 2024 23:14:33 +0100 Subject: [PATCH] Rearranged workflow --- qsgen2 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/qsgen2 b/qsgen2 index 6fdd3e8..1b2dec1 100755 --- a/qsgen2 +++ b/qsgen2 @@ -260,7 +260,7 @@ function _pages_cache() { } function _last_updated() { - sed -e "s|#updated|${TODAY}|" | sed -e "s|\#version|${QSGEN} ${VERSION}|" ${1} + echo ${1} | sed -e "s|#updated|${TODAY}|" | sed -e "s|\#version|${QSGEN} ${VERSION}|" } function _file_to_lower() { @@ -318,9 +318,13 @@ function _pages() { if (${debug}) echo "_pages: Removing #title line from page_content" page_content=$( echo ${page_content} | grep -v \#title ) + # HTML'ify the page content + if (${debug}) echo "_pages: Running engine on ${pages_in_array}" + page_content=$( ${engine} ${page_content} ) + # 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 -e "s|BODY|${page_content}|" ) + pages_tpl=$( echo ${pages_tpl} | sed -e "s|BODY|\"${page_content}\"|" ) # Replace every #pagetitle in pages_tpl if (${debug}) echo "_pages: Replacing #pagetitle in pages_tpl" @@ -344,10 +348,6 @@ function _pages() { pages_title_lower=$( _file_to_lower "${pages_in_array}" ) echo "${pages_tpl}" > ${www_root}/${pages_in_array%.*}.html - # HTML'ify the page content - if (${debug}) echo "_pages: Running engine on ${www_root}/${pages_in_array%.*}.html" - page_content=$( ${engine} ${www_root}/${pages_in_array%.*}.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" if [[ $( grep \#link ${page_content} ) ]]; then @@ -652,7 +652,7 @@ function _html() { local debug=true if (${debug}) echo "${red}_html: Generating HTML for ${1}${end}" - cat ${1} | sed \ + echo ${1} | sed \ -e "s|\#BR|
\n|g" \ -e "s|\#BD||g" \ -e "s|\#EBD||g" \