diff options
author | Steph Enders <steph@senders.io> | 2023-06-26 19:49:02 -0400 |
---|---|---|
committer | Steph Enders <steph@senders.io> | 2023-06-26 19:49:02 -0400 |
commit | 522a9e55821d46e084be43c15e5819594bbee220 (patch) | |
tree | 590e6ebfebfaaf4da583652583738efa09a2fa20 /render.sh | |
parent | 8651853a781f114d9d354264d977105b0028e68a (diff) |
Move entries to pages and rearrange files
Some minor spellchecking also involved here. But basically the intention
is to do:
pages/
More permanent pages
entries/
These are just the articles themselves
templates/
These are page snippets to include around
The intention for splitting out entries is for if I host this also on
gemini the entries are what I can do the processing against vs the page
itself which contains the boilerplate template
Diffstat (limited to 'render.sh')
-rwxr-xr-x | render.sh | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -1,4 +1,13 @@ set -ex; + +function injectTemplate { + tmpl=$1 + dest=$2 + key=$(basename ${tmpl} .html) + sed -i "/[{]${key}[}]/r ${tmpl}" $dest + sed -i "s/[{]${key}[}]//g" $dest +} + if [ $# -ne 2 ]; then echo "Usage: ./render.sh <file> www/<path>/<to>/<prod>.html" exit 1; @@ -11,9 +20,11 @@ mkdir -p $(dirname $DEST) cp $FILE $DEST for tmpl in templates/*.html; do - key=$(basename ${tmpl} .html) - sed -i "/[{]${key}[}]/r ${tmpl}" $DEST - sed -i "s/[{]${key}[}]//g" $DEST + injectTemplate $tmpl $DEST +done +for tmpl in entries/*.html; do + injectTemplate $tmpl $DEST done + ./tidy.sh $DEST |