_pages: Display page title instead of filename

This commit is contained in:
Stig-Ørjan Smelror 2024-02-24 23:12:15 +01:00
parent b4cfa26ff9
commit 0d0010ca79

7
qsgen2
View File

@ -435,6 +435,8 @@ function _pages() {
local debug=false local debug=false
fi fi
_msg main "${0:t}_msg_3"
# Load the cache for Pages # Load the cache for Pages
if (${debug}) _msg debug "${0:t}_msg_1" if (${debug}) _msg debug "${0:t}_msg_1"
_pages_cache _pages_cache
@ -444,8 +446,6 @@ function _pages() {
return return
fi fi
_msg main "${0:t}_msg_3"
if (( ${#pages_array[@]} > 0 )); then if (( ${#pages_array[@]} > 0 )); then
# If pages_array is not empty, we do work # If pages_array is not empty, we do work
@ -467,7 +467,7 @@ function _pages() {
local pages_tpl="$(<${pages})" local pages_tpl="$(<${pages})"
fi fi
_msg std " - ${pages_in_array%.*}.html" # _msg std " - ${pages_in_array%.*}.html"
# Read the file once # Read the file once
if (${debug}) _msg debug "${0:t}_msg_9" " ${pages_in_array}" if (${debug}) _msg debug "${0:t}_msg_9" " ${pages_in_array}"
local page_content="$(<${pages_in_array})" local page_content="$(<${pages_in_array})"
@ -496,6 +496,7 @@ function _pages() {
fi fi
done <<< ${page_content} done <<< ${page_content}
fi fi
_msg std " - ${page_title}"
if (${debug}) _msg debug "${0:t}_msg_11" " ${page_title}" if (${debug}) _msg debug "${0:t}_msg_11" " ${page_title}"
# Remove the #title line from the buffer. No longer needed. # Remove the #title line from the buffer. No longer needed.