fixed preproc-not-done-everywhere bug (simple is beautiful, simple works!)
This commit is contained in:
parent
debacf88fd
commit
79a0d1e6f0
13
html-gen.sh
13
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() {
|
||||
|
|
Loading…
Reference in New Issue