aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Reed <michael@michaelreed.io>2017-07-12 20:04:35 -0400
committerMichael Reed <michael@michaelreed.io>2017-07-13 01:30:25 -0400
commit21c93db2c5ae676ce1e3375d91ccd30a646abaa9 (patch)
tree1cb37e71dd07d78f264a5885b5766a61514b1501
parent82f4b0418bd6ecbd56253274cd4bbbfcb577a1fe (diff)
downloadlibrebootfr-21c93db2c5ae676ce1e3375d91ccd30a646abaa9.tar.gz
librebootfr-21c93db2c5ae676ce1e3375d91ccd30a646abaa9.zip
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.
-rwxr-xr-xwww/index.sh28
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