summaryrefslogtreecommitdiff
path: root/html-gen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'html-gen.sh')
-rw-r--r--html-gen.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/html-gen.sh b/html-gen.sh
index 32edeec..ef03fc8 100644
--- a/html-gen.sh
+++ b/html-gen.sh
@@ -54,25 +54,25 @@ get_article_info() {
git log --format="$1" -- "$articles_dir/$2"
}
get_article_next_file() {
- next=`grep -B1 "$1" "$articles_sorted" | head -1`
+ next=`grep -B1 "^$1$" "$articles_sorted" | head -1`
if [ "$next" != "$1" ]; then
echo "$next"
fi
}
get_article_previous_file() {
- previous=`grep -A1 "$1" "$articles_sorted" | tail -1`
+ previous=`grep -A1 "^$1$" "$articles_sorted" | tail -1`
if [ "$previous" != "$1" ]; then
echo "$previous"
fi
}
get_deleted_next_file() {
- next=`grep -B1 "$1" "$articles_sorted_with_delete" | head -1`
+ next=`grep -B1 "^$1$" "$articles_sorted_with_delete" | head -1`
if [ "`echo $deleted_files | grep -c \"$next\"`" = "0" ]; then
echo "$next"
fi
}
get_deleted_previous_file() {
- previous=`grep -A1 "$1" "$articles_sorted_with_delete" | tail -1`
+ previous=`grep -A1 "^$1$" "$articles_sorted_with_delete" | tail -1`
if [ "`echo $deleted_files | grep -c \"$previous\"`" = "0" ]; then
echo "$previous"
fi
@@ -293,7 +293,7 @@ generate_article() {
regenerate_previous_and_next_article_maybe() {
if [ "$1" != "" -a \
- "`grep -c \"$1\" \"$generated_files\"`" = "0" ]; then
+ "`grep -c \"^$1$\" \"$generated_files\"`" = "0" ]; then
echo -n "[fugitive] Regenerating $public_dir/$1.html"
echo -n " (as previous article) from $articles_dir/$1... "
generate_article "$articles_dir/$1"
@@ -301,7 +301,7 @@ regenerate_previous_and_next_article_maybe() {
echo "$1" >> "$generated_files"
fi
if [ "$2" != "" -a \
- "`grep -c \"$2\" \"$generated_files\"`" = "0" ]; then
+ "`grep -c \"^$2$\" \"$generated_files\"`" = "0" ]; then
echo -n "[fugitive] Regenerating $public_dir/$2.html"
echo -n " (as next article) from $articles_dir/$2... "
generate_article "$articles_dir/$2"