More debug info in _blogs

This commit is contained in:
Stig-Ørjan Smelror 2024-01-30 10:41:17 +01:00
parent f39e1b3b81
commit 804988108a

5
qsgen2
View File

@ -406,7 +406,6 @@ function _blogs() {
_blog_cache
if (( ${#make_blog_array[@]} > 0 )); then
local blog_tpl=$(<"${project_dir}/templates/${theme}/blogs.tpl")
for blog in "${make_blog_array[@]}"; do
if (${debug}) echo "_blogs: Processing ${blog}"
@ -433,6 +432,8 @@ function _blogs() {
# Regular blog creation process
if [[ ! ${mode} ]]; then
local blog_tpl=$(<"${project_dir}/templates/${theme}/blogs.tpl")
for blog in "${make_blog_array[@]}"; do
if (${debug}) echo "_blogs: Processing ${blog}"
@ -455,9 +456,11 @@ function _blogs() {
blog_content="$(_last_updated "${blog_content}")"
# Create directory if it doesn't exist
if (${debug}) echo "_blogs: Creating ${blog_dir}"
[[ ! -d "${www_root}${blog_dir}" ]] && mkdir -p "${www_root}${blog_dir}"
# Write to file
if (${debug}) echo "_blogs: Writing ${blog} to disk: ${www_root}${blog_url}"
echo "${blog_content}" > "${www_root}${blog_url}"
done