diff --git a/bb.sh b/bb.sh
index b6bfe1b..981358a 100755
--- a/bb.sh
+++ b/bb.sh
@@ -666,7 +666,7 @@ all_tags() {
echo "
" >> "$contentfile"
for i in $(ls $prefix_tags*.html); do
echo -n "."
- nposts="$(grep -c "^<\!-- entry begin -->$" $i)"
+ nposts="$(grep -c "<\!-- text begin -->" $i)"
tagname="$(echo $i | cut -c $((${#prefix_tags}+1))- | sed 's/\.html//g')"
echo "- $tagname — $nposts $template_tags_posts
" >> "$contentfile"
done
@@ -720,14 +720,18 @@ rebuild_index() {
rebuild_tags() {
echo -n "Rebuilding tag pages "
n=0
- rm $prefix_tags*.tmp.html &> /dev/null
+ rm $prefix_tags*.html &> /dev/null
# First we will process all files and create temporal tag files
# with just the content of the posts
for i in $(ls -t *.html); do
is_boilerplate_file "$i" && continue;
echo -n "."
tmpfile="$(mktemp tmp.XXX)"
- awk '//, //' "$i" >> "$tmpfile"
+ if [ "$cut_do" ]; then
+ get_html_file_content 'entry' 'entry' 'cut' <$i | awk '/'"$cut_line"'/ { print "'"$template_read_more"'
" ; next } 1' >> "$tmpfile"
+ else
+ get_html_file_content 'entry' 'entry' <$i >> "$tmpfile"
+ fi
while read line; do
if [[ "$line" = "$template_tags_line_header"* ]]; then
# 'split' tags by commas
@@ -739,7 +743,7 @@ rebuild_tags() {
done
done
fi
- done < "$tmpfile"
+ done < "$i"
rm "$tmpfile"
done
# Now generate the tag files with headers, footers, etc