From b004cdbcd88f449128f0e41720c3fc651be45150 Mon Sep 17 00:00:00 2001 From: Carles Fenollosa Date: Fri, 17 Jan 2014 10:03:07 +0100 Subject: Fixed bug when $body_begin_file was empty Added extra line in the footer linking to the github project --- bb.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bb.sh') diff --git a/bb.sh b/bb.sh index 5cc0b49..f866730 100755 --- a/bb.sh +++ b/bb.sh @@ -64,6 +64,8 @@ # ######################################################################################### # +# 2.0.2 Fixed bug when $body_begin_file was empty +# Added extra line in the footer linking to the github project # 2.0.1 Allow personalized header/footer files # 2.0 Added Markdown support # Fully support BSD date @@ -107,7 +109,7 @@ global_config=".config" # by the 'global_config' file contents global_variables() { global_software_name="BashBlog" - global_software_version="2.0.1" + global_software_version="2.0.2" # Blog title global_title="My fancy blog" @@ -342,7 +344,7 @@ create_html_page() { google_analytics >> "$filename" echo "" >> "$filename" # stuff to add before the actual body content - cat "$body_begin_file" >> "$filename" + [[ -n "$body_begin_file" ]] && cat "$body_begin_file" >> "$filename" # body divs echo '
' >> "$filename" echo '
' >> "$filename" @@ -649,7 +651,8 @@ create_includes() { if [[ -f "$footer_file" ]]; then cp "$footer_file" .footer.html else protected_mail="$(echo "$global_email" | sed 's/@/\@/g' | sed 's/\./\./g')" - echo '' >> ".footer.html" + echo '' >> ".footer.html" fi } -- cgit v1.2.3 From 96e26b5aa0f7380ffa916fb408f6a7f25055f757 Mon Sep 17 00:00:00 2001 From: Hans Brigman Date: Mon, 3 Feb 2014 20:10:00 -0500 Subject: Stop Disqus "Comemnts?" link with no username The twitter() method wasn't checking for an empty string for global_disqus_username, so it would always generate the anchor tag for the Disqus comments, even if global_disqus_username was an empty string. Now the '-z' flag has been added to check for the empty string correctly. --- bb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bb.sh') diff --git a/bb.sh b/bb.sh index f866730..327b478 100755 --- a/bb.sh +++ b/bb.sh @@ -305,7 +305,7 @@ edit() { twitter() { [[ -z "$global_twitter_username" ]] && return - if [[ "$global_disqus_username" ]]; then + if [[ -z "$global_disqus_username" ]]; then echo "

$template_comments " else echo "

$template_comments  " -- cgit v1.2.3 From f05f1e834024d5d0bcf30caa26807b24a4b2c5a7 Mon Sep 17 00:00:00 2001 From: Hans Brigman Date: Mon, 3 Feb 2014 21:59:36 -0500 Subject: Don't process header/footer files as blog entries rebuild_all_entries wasn't checking if the file in question being processed was a header or footer file that could be specified in the configuration. Now it checks and skips them if they exist [like the index and archive file(s)]. --- bb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bb.sh') diff --git a/bb.sh b/bb.sh index f866730..5ae9f6d 100755 --- a/bb.sh +++ b/bb.sh @@ -712,7 +712,7 @@ rebuild_all_entries() { echo -n "Rebuilding all entries " for i in *.html; do # no need to sort - if [[ "$i" == "$index_file" ]] || [[ "$i" == "$archive_index" ]]; then continue; fi + if [[ "$i" == "$index_file" ]] || [[ "$i" == "$archive_index" ]] || [[ "$i" == "$footer_file" ]] || [[ "$i" == "$header_file" ]]; then continue; fi contentfile=".tmp.$RANDOM" while [ -f "$contentfile" ]; do contentfile=".tmp.$RANDOM"; done -- cgit v1.2.3