From ddde688aa5c259b6272b0275c736bc84382e20f4 Mon Sep 17 00:00:00 2001 From: Peter Ludikovsky Date: Tue, 16 Feb 2016 12:30:13 +0000 Subject: Sitemap generation --- html-gen.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'html-gen.sh') diff --git a/html-gen.sh b/html-gen.sh index 443719d..2a48c2b 100644 --- a/html-gen.sh +++ b/html-gen.sh @@ -418,6 +418,19 @@ if [ $modification -gt 0 ]; then cp "$temp" "$public_dir/atom.xml" gzip -9kfn "$public_dir/atom.xml" echo "done." + echo -n "[fugitive] Generating $public_dir/sitemap.xml... " + cat "$templates_dir/sitemap.xml" | \ + replace_includes | \ + replace_foreach "article" "$articles_sorted" | \ + replace_foreach "commit" "$commits" | \ + replace_empty_article_info | \ + replace_str "page_title" "archives" | \ + replace_str "blog_url" "$blog_url" | \ + replace_commit_info "-1" | \ + sed "/^[[:space:]]*$/d" > "$temp" + cp "$temp" "$public_dir/sitemap.xml" + gzip -9kfn "$public_dir/sitemap.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" -- cgit v1.2.3