diff options
author | Peter Ludikovsky <peter@ludikovsky.name> | 2016-02-15 19:28:37 +0000 |
---|---|---|
committer | Peter Ludikovsky <peter@ludikovsky.name> | 2016-02-15 19:28:37 +0000 |
commit | c2547e0b684e61539666ec6d130145fe1c59f341 (patch) | |
tree | a034f2ac86d5bdb637aa01adefe5cd3e5a69c970 /html-gen.sh | |
parent | cd10c52edb146a0542cce6a65cfb3ae134c232dc (diff) |
Added support for Atom feeds, improved validation for RSS feeds
Diffstat (limited to 'html-gen.sh')
-rw-r--r-- | html-gen.sh | 21 |
1 files changed, 18 insertions, 3 deletions
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... " |