From a27fa0c2e26eb2e30e220fd68cd5ee910474b602 Mon Sep 17 00:00:00 2001 From: Bradley Taunt Date: Fri, 2 Feb 2024 12:39:46 -0500 Subject: Initial commit to new cgit platform --- script.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 script.sh (limited to 'script.sh') diff --git a/script.sh b/script.sh new file mode 100755 index 0000000..f129bfe --- /dev/null +++ b/script.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# Configuration +DOMAIN="https://shinobi.btxx.org" +TITLE="Shinobi" +DESCRIPTION="A text-based, RSS focused blogging system" +COPYRIGHT="2022 Bradley Taunt" +# RW_DIR="_posts/" +POST_DIR="posts/" +TTL="60" +AUTHOR="bt@btxx.org(Bradley Taunt)" +TIME=$(date +"%T %Z") + +# Advanced Setting: Automatically wrap plain text files at 72 character limit +# Detailed documentation: https://git.btxx.org/shinobi +# +# for i in $(find $RW_DIR -type f); do cp $i $POST_DIR ; done +# for i in $(find $POST_DIR -type f); do fold -s -w 72 $i > $i.temp; mv $i.temp $i ; done + +echo " + + + + $TITLE + $DOMAIN + $DESCRIPTION + $COPYRIGHT + $TTL"; + +for file in $POST_DIR*; do + +echo " + $(head -n 1 $file) $TIME + $(date -d "$(head -n 1 $file)" +"%Y/%m/%d/%u") + $(head -n 2 $file | tail -n 1) + $DOMAIN/$file + + $(tail -n +4 $file | sed 's/&/\&/g; s//\>/g; s/"/\"/g; s/'"'"'/\'/g')]]> + + $AUTHOR + $DOMAIN/$file + "; +done + +echo " +"; -- cgit v1.2.3-54-g00ecf