diff --git a/bb.sh b/bb.sh index fa308f3..961eda9 100755 --- a/bb.sh +++ b/bb.sh @@ -90,10 +90,10 @@ global_config=".config" global_variables() { - if [[ -z $EDITOR ]]; then EDITOR=vim; fi + echo Loading inline configuration global_software_name="BashBlog" - global_software_version="1.5.1" + global_software_version="1.6.0" # Blog title global_title="My fancy blog" @@ -124,6 +124,10 @@ global_variables() { global_twitter="true" global_twitter_username="example" + # Leave these empty if you don't want to use disqus for comments + global_disqus="true" + global_disqus_username="disqus_undefined" + # Blog generated files # index page of blog (it is usually good to use "index.html" here) @@ -175,6 +179,45 @@ google_analytics() { " } +# Prints the required code for disqus comments +disqus_body() { +if [ "$global_disqus" != "" ]; then + echo '
+ + + comments powered by Disqus' +fi + +} +# Prints the required code for disqus in the footer +disqus_footer() { +if [ "$global_disqus" != "" ]; then + echo '' + + fi +} + # Edit an existing, published .html file while keeping its original timestamp # Please note that this function does not automatically republish anything, as # it is usually called from 'main'. @@ -266,13 +309,13 @@ create_html_page() { echo '' >> "$filename" # content echo ${filename%.*.*} if [[ ${filename%.*.*} != "index" && ${filename%.*.*} != "all_posts" ]]; then - cat disqus >> "$filename" + disqus_body >> "$filename" fi # page footer cat .footer.html >> "$filename" # close divs echo '' >> "$filename" # divbody and divbodyholder - cat disqus_footer >> "$filename" + disqus_footer >> "$filename" echo '