Don't echo all the content all the time

This commit is contained in:
Stig-Ørjan Smelror 2024-01-29 21:58:42 +01:00
parent 77148baa42
commit e308639af8

10
qsgen2
View File

@ -310,10 +310,10 @@ function _pages() {
local page_content="$(<${pages_in_array})"
# Grab the title from the Page
page_title=$( echo ${page_content} | head -2 | grep '#title' | cut -d= -f2 )
page_title=$( grep '#title' ${page_content} | head -2 | cut -d= -f2 )
# Remove the #title line from the buffer. No longer needed.
page_content=$( echo ${page_content} | grep -v '#title' )
page_content=$( grep -v '#title' ${page_content} )
# HTML'ify the page content
page_content=$( ${engine} ${page_content} )
@ -331,13 +331,13 @@ function _pages() {
fi
# Insert page_content into pages_tpl by replacing the BODY tag present there
page_tpl=$( echo ${page_tpl} | sed -e "s|BODY|${page_content}|" )
page_tpl=$( sed -e "s|BODY|${page_content}|" ${page_tpl} )
# Replace every #pagetitle in pages_tpl
pages_tpl=$( echo ${pages_tpl} | sed -e "s|#pagetitle|${page_title}|g" )
pages_tpl=$( sed -e "s|#pagetitle|${page_title}|g" ${pages_tpl} )
# Replace every #tagline in pages_tpl
pages_tpl=$( echo ${pages_tpl} | sed -e "s|#tagline|${site_tagline}|g" )
pages_tpl=$( sed -e "s|#tagline|${site_tagline}|g" ${pages_tpl} )
# Replace #updated with today's date and #version with Name and Version to footer
pages_tpl=$( _last_updated ${pages_tpl} )