diff --git a/qsgen2 b/qsgen2 index 047368a..64222a8 100755 --- a/qsgen2 +++ b/qsgen2 @@ -322,10 +322,6 @@ function _pages() { 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}|g' > /dev/null ) - # Replace every #pagetitle in pages_tpl if (${debug}) echo "_pages: Replacing #pagetitle in pages_tpl" pages_tpl=$( echo ${pages_tpl} | sed -e "s|#pagetitle|${page_title}|g" > /dev/null ) @@ -338,6 +334,10 @@ function _pages() { if (${debug}) echo "_pages: _last_updated in pages_tpl" pages_tpl=$( _last_updated ${pages_tpl} ) + # 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}|g" > /dev/null ) + # Run a cleanup if in case something was left out _cleanup ${pages_tpl}