diff --git a/bb.sh b/bb.sh index 3cc5656..a53ce6d 100755 --- a/bb.sh +++ b/bb.sh @@ -392,7 +392,7 @@ is_boilerplate_file() { ( "$index_file" | "$archive_index" | "$tags_index" | "$footer_file" | "$header_file" | "$global_analytics_file" | "$prefix_tags"* ) return 0 ;; ( * ) # Check for excluded - for excl in ${html_exclude[*]}; do + for excl in "${html_exclude[@]}"; do [[ $name == "$excl" ]] && return 0 done return 1 ;; @@ -523,9 +523,9 @@ parse_file() { IFS=, read -r -a array <<< "$tags" echo -n "
$template_tags_line_header " >> "$content" - (for item in "${array[@]}"; do + for item in "${array[@]}"; do echo -n "$item, " - done ) | sed 's/, $/<\/p>/g' >> "$content" + done | sed 's/, $/<\/p>/g' >> "$content" else echo "$line" >> "$content" fi @@ -738,7 +738,7 @@ rebuild_index() { # Accepts either filename as first argument, or post content at stdin # Prints one line with space-separated tags to stdout tags_in_post() { - sed -n "/^
$template_tags_line_header/{s/^
$template_tags_line_header//;s/<[^>]*>//g;s/[ ,]\+/ /g;p;}" $1 | tr ', ' ' ' + sed -n "/^
$template_tags_line_header/{s/^
$template_tags_line_header//;s/<[^>]*>//g;s/[ ,]\+/ /g;p;}" "$1" | tr ', ' ' ' } # Finds all posts referenced in a number of tags. @@ -746,8 +746,9 @@ tags_in_post() { # Prints one line with space-separated tags to stdout posts_with_tags() { (($# < 1)) && return - tag_files=$(for i in "$@"; do echo -n $prefix_tags""$i.html" "; done) - sed -n '/^