From e308639af8250007532d4a7042c89e0cbc6d0515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Mon, 29 Jan 2024 21:58:42 +0100 Subject: [PATCH] Don't echo all the content all the time --- qsgen2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qsgen2 b/qsgen2 index 6eaf84d..8df5a9d 100755 --- a/qsgen2 +++ b/qsgen2 @@ -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} )