From 37bef699bfbe202f014053b099a75a965d7473a6 Mon Sep 17 00:00:00 2001 From: Carlos Date: Thu, 14 Jan 2016 16:39:56 +0100 Subject: fixed posts singular/plural --- bb.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'bb.sh') diff --git a/bb.sh b/bb.sh index 2bd572b..9fb3c07 100755 --- a/bb.sh +++ b/bb.sh @@ -110,6 +110,7 @@ global_variables() { 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" + template_tags_posts_singular="post" # "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) @@ -689,7 +690,9 @@ all_tags() { nposts=$(grep -c "<\!-- text begin -->" "$i") tagname=$(echo "$i" | cut -c "$((${#prefix_tags}+3))-" | sed 's/\.html//g') i=$(clean_filename "$i") - echo "
  • $tagname — $nposts $template_tags_posts
  • " + word=$template_tags_posts_singular + (($nposts > 1)) && word=$template_tags_posts + echo "
  • $tagname — $nposts $word
  • " done echo "" 1>&3 echo "" @@ -836,7 +839,9 @@ list_tags() { nposts=$(grep -c "<\!-- text begin -->" "$i") tagname=$(echo "$i" | cut -c "$((${#prefix_tags}+3))-" | sed 's/\.html//g') i=$(clean_filename "$i") - line="$tagname # $nposts # $template_tags_posts" + word=$template_tags_posts_singular + (($nposts > 1)) && word=$template_tags_posts + line="$tagname # $nposts # $word" lines+=$line\\n done -- cgit v1.2.3