diff options
-rwxr-xr-x | www/index.sh | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/www/index.sh b/www/index.sh index 5cd15818..27549cc5 100755 --- a/www/index.sh +++ b/www/index.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # # Copyright (C) 2017 Alyssa Rosenzweig <alyssa@rosenzweig.io> +# Copyright (C) 2017 Michael Reed <michael@michaelreed.io> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +20,10 @@ BLOGTITLE="Libreboot News" BLOGBASE="https://libreboot.org/" BLOGDESCRIPTION="News on Libreboot development" +# MANIFEST determines the order of news articles in news/index.md +FILES=$(< news/MANIFEST) + + # usage: title file title() { sed -n 1p "$1" | sed -e s-^..-- @@ -38,20 +43,6 @@ meta() { printf '\n' } -# generate the index file - -# MANIFEST determines the order of news articles in news/index.md -FILES=$(< news/MANIFEST) - -cat news-list.md > news/index.md - -for f in $FILES -do - meta "$f" >> news/index.md -done - -# generate an RSS index - rss() { printf '%s\n' '<rss version="2.0">' printf '%s\n' '<channel>' @@ -77,5 +68,14 @@ rss() { printf '%s\n' '</rss>' } + +# generate the index file +cat news-list.md > news/index.md +for f in $FILES +do + meta "$f" >> news/index.md +done + +# generate the RSS index rss > news/feed.xml cp news/feed.xml feed.xml |