From 21c93db2c5ae676ce1e3375d91ccd30a646abaa9 Mon Sep 17 00:00:00 2001 From: Michael Reed Date: Wed, 12 Jul 2017 20:04:35 -0400 Subject: www/index.sh: Organize in a less surprising manner I find it easier to read this file if all function definitions come first, then all the actual stuff we do comes at the end. --- www/index.sh | 28 ++++++++++++++-------------- 1 file 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 +# Copyright (C) 2017 Michael Reed # # 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' '' printf '%s\n' '' @@ -77,5 +68,14 @@ rss() { printf '%s\n' '' } + +# 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 -- cgit v1.2.3-70-g09d2