Found a typo and more changes

This commit is contained in:
Stig-Ørjan Smelror 2024-01-29 22:47:42 +01:00
parent b2591150a3
commit 36c611a00c

9
qsgen2
View File

@ -312,15 +312,18 @@ function _pages() {
# Grab the title from the Page
if (${debug}) echo "_pages: Grepping for page_title"
page_title=$( echo ${page_content} | head -1 | grep '#title' | cut -d= -f2 )
page_title=$( echo ${page_content} | head -1 | grep \#title | cut -d= -f2 )
# Remove the #title line from the buffer. No longer needed.
page_content=$( grep -v '#title' ${page_content} )
if (${debug}) echo "_pages: Removing #title line from page_content"
page_content=$( grep -v \#title ${page_content} )
# HTML'ify the page content
if (${debug}) echo "_pages: Running engine on page_content"
page_content=$( ${engine} ${page_content} )
# 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
echo "If #link is present, run _link: ${page_content}"
_link ${page_content}
@ -333,7 +336,7 @@ function _pages() {
fi
# Insert page_content into pages_tpl by replacing the BODY tag present there
page_tpl=$( sed -e "s|BODY|${page_content}|" ${page_tpl} )
pages_tpl=$( sed -e "s|BODY|${page_content}|" ${pages_tpl} )
# Replace every #pagetitle in pages_tpl
pages_tpl=$( sed -e "s|#pagetitle|${page_title}|g" ${pages_tpl} )