summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Ludikovsky <peter@ludikovsky.name>2016-02-16 09:51:56 +0000
committerPeter Ludikovsky <peter@ludikovsky.name>2016-02-16 09:51:56 +0000
commit3a663690dcdd1e17a335d4e2305f595510ba26cf (patch)
treec78fdf5f60e296efa65fa713b77a6b797943bd48
parentca6aa6f9678bb744ce613d32658cd4d79cc1bdee (diff)
parentf6f8e8829f20115ff4d5665a7db6f0c6720cda2c (diff)
Merge branch 'compress' into sitemap
-rw-r--r--html-gen.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/html-gen.sh b/html-gen.sh
index a98a1d7..406da7f 100644
--- a/html-gen.sh
+++ b/html-gen.sh
@@ -330,6 +330,9 @@ for f in $added_files $modified_files; do
echo -n " $f... "
generate_article "$f"
echo "done."
+ echo -n "[fugitive] Generating $public_dir/${f#$articles_dir/}.html.gz... "
+ gzip -9k $public_dir/${f#$articles_dir/}.html
+ echo "done."
echo "${f#$articles_dir/}" >> "$generated_files"
fi
done
@@ -339,6 +342,7 @@ for f in $added_files; do
art="${f#$articles_dir/}"
echo -n "[fugitive] Adding $public_dir/$art.html to git ignore list... "
echo "$public_dir/$art.html" >> .git/info/exclude
+ echo "$public_dir/$art.html.gz" >> .git/info/exclude
echo "done."
previous=`get_article_previous_file "$art"`
next=`get_article_next_file "$art"`
@@ -353,8 +357,12 @@ for f in $deleted_files; do
echo -n "[fugitive] Deleting $public_dir/$art.html... "
rm "$public_dir/$art.html"
echo "done."
+ echo -n "[fugitive] Deleting $public_dir/$art.html.gz... "
+ rm "$public_dir/$art.html.gz"
+ echo "done."
echo -n "[fugitive] Removing $art.html from git ignore list... "
sed -i "/^$public_dir\/$art.html$/d" .git/info/exclude
+ sed -i "/^$public_dir\/$art.html.gz$/d" .git/info/exclude
echo "done."
previous=`get_deleted_previous_file "$art"`
next=`get_deleted_next_file "$art"`
@@ -376,6 +384,7 @@ if [ $modification -gt 0 ]; then
replace_commit_info "-1" | \
sed "/^[[:space:]]*$/d" > "$temp"
cp "$temp" "$public_dir/archives.html"
+ gzip -9k "$public_dir/archives.html"
echo "done."
echo -n "[fugitive] Generating $public_dir/rss.xml... "
last_5_articles=`mktemp fugitiveXXXXXX`
@@ -391,6 +400,7 @@ if [ $modification -gt 0 ]; then
replace_commit_info "-1" | \
sed "/^[[:space:]]*$/d" > "$temp"
cp "$temp" "$public_dir/rss.xml"
+ gzip -9k "$public_dir/rss.xml"
echo "done."
echo -n "[fugitive] Generating $public_dir/atom.xml... "
last_5_articles=`mktemp fugitiveXXXXXX`
@@ -406,10 +416,12 @@ if [ $modification -gt 0 ]; then
replace_commit_info "-1" | \
sed "/^[[:space:]]*$/d" > "$temp"
cp "$temp" "$public_dir/atom.xml"
+ gzip -9k "$public_dir/atom.xml"
echo "done."
rm "$last_5_articles" "$last_5_commits" "$temp"
echo -n "[fugitive] Using last published article as index page... "
cp "$public_dir/`head -1 $articles_sorted`.html" "$public_dir/index.html"
+ gzip -9k "$public_dir/index.html"
echo "done".
echo "[fugitive] Blog update complete."
fi