From: MatthewOwens Date: Fri, 17 Jul 2020 20:15:44 +0000 (+0100) Subject: added gen_index script X-Git-Url: https://git.owens.tech/assets/static/git-favicon.png/assets/static/git-favicon.png/git?a=commitdiff_plain;h=619508a37640e509ffbee1fc820205d83846a337;p=website.git added gen_index script --- diff --git a/scripts/gen_index.sh b/scripts/gen_index.sh new file mode 100755 index 0000000..c772b25 --- /dev/null +++ b/scripts/gen_index.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +#[ $# -ne 1 ] && exit 1 + +POSTS_DIR=posts +POSTS=$(ls $POSTS_DIR | sed 's/ /\r\n/') +MATCH="^([0-9]{1,4})-([0-9]{1,4})-([0-9]{1,4})-([^\.]+)(.*)" + +sed "s|TITLE|Matthew Owens|" 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 diff --git a/scripts/posts.awk b/scripts/posts.awk new file mode 100644 index 0000000..fe2e577 --- /dev/null +++ b/scripts/posts.awk @@ -0,0 +1,16 @@ +BEGIN { + #OFS="" + #FS="[-.]" + print "" +}