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" \