From c2547e0b684e61539666ec6d130145fe1c59f341 Mon Sep 17 00:00:00 2001 From: Peter Ludikovsky Date: Mon, 15 Feb 2016 19:28:37 +0000 Subject: Added support for Atom feeds, improved validation for RSS feeds --- html-gen.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'html-gen.sh') diff --git a/html-gen.sh b/html-gen.sh index 6974d80..a98a1d7 100644 --- a/html-gen.sh +++ b/html-gen.sh @@ -377,12 +377,12 @@ if [ $modification -gt 0 ]; then sed "/^[[:space:]]*$/d" > "$temp" cp "$temp" "$public_dir/archives.html" echo "done." - echo -n "[fugitive] Generating $public_dir/feed.xml... " + echo -n "[fugitive] Generating $public_dir/rss.xml... " last_5_articles=`mktemp fugitiveXXXXXX` head -5 "$articles_sorted" > "$last_5_articles" last_5_commits=`mktemp fugitiveXXXXXX` head -5 "$commits" > "$last_5_commits" - cat "$templates_dir/feed.xml" | \ + cat "$templates_dir/rss.xml" | \ replace_includes | \ replace_foreach "article" "$last_5_articles" | \ replace_foreach "commit" "$last_5_commits" | \ @@ -390,7 +390,22 @@ if [ $modification -gt 0 ]; then replace_str "blog_url" "$blog_url" | \ replace_commit_info "-1" | \ sed "/^[[:space:]]*$/d" > "$temp" - cp "$temp" "$public_dir/feed.xml" + cp "$temp" "$public_dir/rss.xml" + echo "done." + echo -n "[fugitive] Generating $public_dir/atom.xml... " + last_5_articles=`mktemp fugitiveXXXXXX` + head -5 "$articles_sorted" > "$last_5_articles" + last_5_commits=`mktemp fugitiveXXXXXX` + head -5 "$commits" > "$last_5_commits" + cat "$templates_dir/atom.xml" | \ + replace_includes | \ + replace_foreach "article" "$last_5_articles" | \ + replace_foreach "commit" "$last_5_commits" | \ + replace_str "page_title" "feed" | \ + replace_str "blog_url" "$blog_url" | \ + replace_commit_info "-1" | \ + sed "/^[[:space:]]*$/d" > "$temp" + cp "$temp" "$public_dir/atom.xml" echo "done." rm "$last_5_articles" "$last_5_commits" "$temp" echo -n "[fugitive] Using last published article as index page... " -- cgit v1.2.3