31 lines
1.3 KiB
Plaintext

if [[ ${globaldebug} == "true" ]]; then
local debug=true
else
local debug=false
fi
if ([[ ${config[site_blog]} == "false" ]] && [[ ${new_updated_blogs} = "true" ]]); then
if (${debug}) _msg debug "${0:t}_msg_1" "${config[site_blog]}"
if (${debug}) _msg debug "${0:t}_msg_2" "${new_updated_blogs}"
if (${debug}) _msg debug "${0:t}_msg_3"
if (${debug}) _msg debug "${0:t}_msg_4" " ${config[site_blog]}"
_msg std "${0:t}_msg_5" " ${config[site_root]}/blog/index.html"
local blog_index_tpl=$(<${config[project_root]}/themes/${config[site_theme]}/blog_index.tpl)
local blog_index_list=$(<${config[project_root]}/blog/index.tmp.html)
if (${debug}) _msg debug "${0:t}_msg_6"
local blog_index_content=$(echo "${blog_index_tpl}" | perl -pe "s|#sitename|${config[site_name]}|gs; s|#tagline|${config[site_tagline]}|gs")
if (${debug}) _msg debug "${0:t}_msg_7" " ${config[project_root]}/blog/index.tmp.html"
blog_index_content=$( awk -v new_body="$blog_index_list" '{sub(/BODY/, new_body)} 1' <(echo "${blog_index_content}") )
if (${debug}); then
_msg debug "${0:t}_msg_8" " ${config[site_root]}/blog/index.html"
_msg debug "${0:t}_msg_9" " ${#blog_index_content}"
fi
echo "$blog_index_content" > ${config[site_root]}/blog/index.html
_f_last_updated ${config[site_root]}/blog/index.html
fi