_blog_index: Debug

This commit is contained in:
Stig-Ørjan Smelror 2024-02-05 13:59:23 +01:00
parent 63c1976011
commit 9557dc1971

8
qsgen2
View File

@ -753,7 +753,7 @@ function _blog_idx_for_index() {
function _blog_index() {
local debug=false
local debug=true
# This function generates the /blog/index.html file that gets its data from _blog_list_for_index()
# ${new_updated_blogs} comes from the function _blogs if anything new or updated is detected
@ -762,14 +762,14 @@ function _blog_index() {
if (${debug}) _msg debug "Running function _blog_index"
if (${debug}) _msg debug "_blog_index: blog_in_index = ${blog_in_index}"
_msg std "Generating the Blog index file"
_msg std "- Generating the Blog index file"
local debug=false
local blog_index_tpl=$(<${project_dir}/themes/${theme}/blog_index.tpl)
local blog_index_list=$(<${project_dir}/blog/index.tmp.html)
local blog_index_content=$( awk -v new_body="$blog_index_list" '{sub(/BODY/, new_body)} 1' <(echo "${blog_index_tpl}") )
blog_index_content=$(echo "${blog_index_tpl}" | perl -pe "s|#sitename|${site_name}|gs; s|#tagline|${site_tagline}|gs")
local blog_index_content=$(echo "${blog_index_tpl}" | perl -pe "s|#sitename|${site_name}|gs; s|#tagline|${site_tagline}|gs")
blog_index_content=$( awk -v new_body="$blog_index_list" '{sub(/BODY/, new_body)} 1' <(echo "${blog_index_tpl}") )
echo "${blog_index_content}" > ${www_root}/blog/index.html
_f_last_updated ${www_root}/blog/index.html