sorting posts
authorMatthewOwens <matthew@owens.tech>
Tue, 21 Jul 2020 16:40:40 +0000 (17:40 +0100)
committerMatthewOwens <matthew@owens.tech>
Tue, 21 Jul 2020 16:40:40 +0000 (17:40 +0100)
scripts/gen_index.sh

index 8fb0297..da61039 100755 (executable)
@@ -8,7 +8,7 @@ MATCH="^([0-9]{1,4})-([0-9]{1,4})-([0-9]{1,4})-([^\.]+)(.*)"
 
 sed "s|TITLE|<title>Matthew Owens</title>|" includes/head.html
 cat includes/header.html
-ls $POSTS_DIR | sed -Ee 's/ /\n/' -e "s/$MATCH/\1 \2 \3 \4/" | awk -f scripts/posts.awk
+ls $POSTS_DIR | sort -nr | sed -Ee 's/ /\n/' -e "s/$MATCH/\1 \2 \3 \4/" | awk -f scripts/posts.awk
 echo "<div id=\"about-section\">"
 markdown about.md
 echo "</div>"