diff --git a/qsgen2 b/qsgen2
index 9b375a5..b198dee 100755
--- a/qsgen2
+++ b/qsgen2
@@ -533,9 +533,11 @@ function _blogs() {
done
# Now BLOG_META_STR_ARRAY contains the metadata string for each blog post
export BLOG_META_STR_ARRAY
+ export new_updated_blogs=true
else
_msg info "No new or updated Blogs detected."
+ export new_updated_blogs=false
fi
}
@@ -598,21 +600,23 @@ function _blog_idx_for_index() {
function _blog_index() {
# This function generates the /blog/index.html file that gets its data from _blog_list_for_index()
- if [[ ${blog_in_index} == "false" ]]; then
-
- _msg info "Running function _blog_index"
+ # ${new_updated_blogs} comes from the function _blogs if anything new or updated is detected
+ if [[ ${blog_in_index} == "false" ]] && [[ ${new_updated_blogs} = "true" ]]; then
+
+ if (${debug}) _msg debug "Running function _blog_index"
if (${debug}) _msg debug "_blog_index: blog_in_index = ${blog_in_index}"
-
+
+ _msg std "Updating the Blog Index file"
+
local debug=false
local blog_index=$(<${project_dir}/themes/${theme}/blog_index.tpl)
local blog_index_list=$(<${project_dir}/blog/index.tmp.html)
- _msg std "Updating the Blog Index file"
blog_index_content=$(echo "${blog_index}" | perl -pe "s|BODY|${blog_index_list}|g")
echo "${blog_index_content}" > ${www_root}/blog/index.html
_f_last_updated ${www_root}/blog/index.html
fi
-
+
}
function _sitemap() {
@@ -779,54 +783,77 @@ function _cleanup() {
}
function _html() {
+
# This function converts formatting tags into their HTML equivalents in a provided string
-
+ # using QStags (QS-tags)
+
local content="${1}"
local debug=false
- if (${debug}) _msg debug "_html: Generating HTML from content"
+ if (${debug}); then _msg debug "_html: Converting QStags in content"; fi
- # Perform HTML tag substitutions
+ # Perform HTML tag substitutions handling both lowercase and uppercase QStags
local html_content=$(echo "${content}" | sed \
- -e "s|#BR|
|g" \
- -e "s|#BD||g" \
- -e "s|#EBD||g" \
- -e "s|#UN||g" \
- -e "s|#EUN||g" \
- -e "s|#P|
|g" \ - -e "s|#EP|
|g" \ - -e "s|#Q||g" \ - -e "s|#EQ||g" \ - -e "s|#STRONG||g" \ - -e "s|#ESTRONG||g" \ - -e "s|#I||g" \ - -e "s|#EI||g" \ - -e "s|#C|
|g" \
- -e "s|#EC|
|g" \
- -e "s|#EM||g" \
- -e "s|#SEM||g" \
- -e "s|#OT|"|g" \
- -e "s|#UL||g" \ + -e "s|#[eE][pP]|
|g" \ + -e "s|#[hH]1|