From 6145acc5dafae374c10a3c0e5ca6d871fb5acc2d Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Sun, 18 Aug 2019 00:03:51 -0700 Subject: [PATCH] smol todo and how tf did i remove the make script --- make.sh | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ todo.md | 5 +++++ 2 files changed, 62 insertions(+) create mode 100755 make.sh create mode 100644 todo.md diff --git a/make.sh b/make.sh new file mode 100755 index 0000000..70b8619 --- /dev/null +++ b/make.sh @@ -0,0 +1,57 @@ +#!/bin/bash +rootDir='./site/' +targetDir='post/' + +post() { + tmp=".swap" + full=".fullswap" + base=$(basename $1) + # First build the content of the site + pandoc $1 | sed '3i ' >> $tmp + sed -i '1i
' $tmp + # next we glue together the header and footer + cat ./templates/post-header.html $tmp ./templates/post-footer.html > $full + rm -f $tmp + # Title, images and tables get added/fixed here + sed -i "5i ${base%.*}" $full + sed -i "s///g' $full + + # finally move this post to its proper location in the _rootDir + mv $full "$rootDir/$targetDir/${base%.*}.html" + rm -f $full +} + +_help() { + echo 'Options: + -p [postDirectory/*] + -r (build root pages) + -s (copy stylesheets)' +} +mkdir -p "$rootDir/post" + +while getopts ":srhp:" opt;do + case "$opt" in + s) + cp style.css "$rootDir" # root stylesheet + cp style.css "$rootDir/$targetDir" # post stylesheet + exit 0 + ;; + r) + # Fix targetDir so that it points to the root of the site output + targetDir='' + post './prebuild/about.md' + post './prebuild/links.md' + post './prebuild/index.md' + exit 0 + ;; + p) + for file in ${@:2};do + #echo $file + post $file + done + ;; + h) + _help;; + esac +done diff --git a/todo.md b/todo.md new file mode 100644 index 0000000..22dea4f --- /dev/null +++ b/todo.md @@ -0,0 +1,5 @@ +# QOL + +Find some server that I can run to simulate the neocities env + +Hooks from gitlab to automatically push to the website