diff --git a/bb.sh b/bb.sh index d2324fe..2659346 100755 --- a/bb.sh +++ b/bb.sh @@ -181,6 +181,12 @@ global_variables() { template_archive_title="All posts" # "All tags" template_tags_title="All tags" + # "posts" (on "All tags" page, text at the end of each tag line, like "2. Music - 15 posts") + template_tags_posts="posts" + # "Posts tagged" (text on a title of a page with index of one tag, like "My Blog - Posts tagged "Music"") + template_tag_title="Posts tagged" + # "Tags:" (beginning of line in HTML file with list of all tags for this article) + template_tags_line_header="Tags:" # "Back to the index page" (used on archive page, it is link to blog index) template_archive_index_page="Back to the index page" # "Subscribe" (used on bottom of index page, it is link to RSS feed) @@ -487,13 +493,13 @@ write_entry() {

The rest of the text file is an html blog post. The process will continue as soon as you exit your editor.

-

Tags: keep-this-tag-format, tags-are-optional, example

+

$template_tags_line_header keep-this-tag-format, tags-are-optional, example

EOF [[ "$fmt" == "md" ]] && cat << EOF >> "$TMPFILE" The rest of the text file is a **Markdown** blog post. The process will continue as soon as you exit your editor. -Tags: keep-this-tag-format, tags-are-optional, beware-with-underscores-in-markdown, example +$template_tags_line_header keep-this-tag-format, tags-are-optional, beware-with-underscores-in-markdown, example EOF fi chmod 600 "$TMPFILE" @@ -546,11 +552,11 @@ EOF # Parse possible tags cp "$filename" "$filename.bak" while read line; do - if [[ "$line" = "

Tags:"* ]]; then + if [[ "$line" = "

$template_tags_line_header"* ]]; then tags="$(echo "$line" | cut -d ":" -f 2- | sed -e 's/<\/p>//g' -e 's/^ *//' -e 's/ *$//' -e 's/, /,/g')" IFS=, read -r -a array <<< "$tags" - echo -n "

Tags: " + echo -n "

$template_tags_line_header " (for item in "${array[@]}"; do echo -n "$item, " done ) | sed 's/, $//g' @@ -604,11 +610,11 @@ all_tags() { echo "

$template_tags_title

" >> "$contentfile" echo "" >> "$contentfile" @@ -665,7 +671,7 @@ rebuild_tags() { tmpfile="$(mktemp tmp.XXX)" awk '//, //' "$i" >> "$tmpfile" while read line; do - if [[ "$line" = "

Tags:"* ]]; then + if [[ "$line" = "

$template_tags_line_header"* ]]; then # 'split' tags by commas echo "$line" | cut -c 10- | while IFS="," read -a tags; do for dirty_tag in "${tags[@]}"; do # extract html around it @@ -681,7 +687,7 @@ rebuild_tags() { # Now generate the tag files with headers, footers, etc for i in $(ls -t $prefix_tags*.tmp.html); do tagname="$(echo $i | cut -c $((${#prefix_tags}+1))- | sed 's/\.tmp\.html//g')" - create_html_page "$i" "$prefix_tags$tagname.html" yes "$global_title — Posts tagged \"$tagname\"" + create_html_page "$i" "$prefix_tags$tagname.html" yes "$global_title — $template_tag_title \"$tagname\"" rm "$i" done echo