summaryrefslogtreecommitdiff
path: root/html-gen.sh
diff options
context:
space:
mode:
authorp4bl0 <r@uzy.me>2011-08-25 13:23:52 +0200
committerp4bl0 <r@uzy.me>2011-08-25 13:23:52 +0200
commit79a0d1e6f033df3751d4043ecddd7c44fca9b1ee (patch)
tree0278cb18afeaa1689c7469239496691f113ebf03 /html-gen.sh
parentdebacf88fdfa9506d85398eac5f31ebefd817069 (diff)
fixed preproc-not-done-everywhere bug (simple is beautiful, simple works!)
Diffstat (limited to 'html-gen.sh')
-rw-r--r--html-gen.sh13
1 files changed, 2 insertions, 11 deletions
diff --git a/html-gen.sh b/html-gen.sh
index 66ad090..f6d0237 100644
--- a/html-gen.sh
+++ b/html-gen.sh
@@ -8,6 +8,7 @@ public_dir=`git config --get fugitive.public-dir`
if [ ! -d "$public_dir" ]; then mkdir -p "$public_dir"; fi
articles_dir=`git config --get fugitive.articles-dir`
preproc=`git config --get fugitive.preproc`
+if [ "$preproc" = "" ]; then preproc="cat"; fi
tpl_change=`echo "$added_files" "$modified_files" "$deleted_files" | \
grep -c "$templates_dir/"`
@@ -84,7 +85,7 @@ get_article_title() {
}
get_article_content() {
tmp=`mktemp fugitiveXXXXXX`
- tail -n+2 "$articles_dir/$1" > "$tmp"
+ tail -n+2 "$articles_dir/$1" | ($preproc) > "$tmp"
echo "$tmp"
}
@@ -289,22 +290,12 @@ replace_foreach () {
generate_article() {
art="${1#$articles_dir/}"
title=`get_article_title "$art"`
- if [ "$preproc" != "" ]; then
- body=`get_article_content "$art"`
- echo "$title" > "$1"
- ($preproc) < "$body" >> "$1"
- fi
cat "$templates_dir/article.html" | \
replace_includes | \
replace_str "page_title" "$title" | \
replace_str "blog_url" "$blog_url" | \
replace_commit_info "-1" | \
replace_article_info "$art" > "$public_dir/$art.html"
- if [ "$preproc" != "" ]; then
- echo "$title" > "$1"
- cat "$body" >> "$1"
- rm "$body"
- fi
}
regenerate_previous_and_next_article_maybe() {