Got rid of janky build.sh script. Now uses a bunch of janky scripts and a make file - because that is bound to be easier to maintain.
27 lines
605 B
Bash
Executable file
27 lines
605 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
case "$1" in
|
|
tag)
|
|
title="Archive: $(echo "$ALLTAGS" | tr ' _' '\n ' | grep -i "$(echo "$2" | tr '_' ' ')")"
|
|
template="$(echo "" | pandoc --template=templates/blog.html \
|
|
-f markdown -t html5 -M archive -M title:"$title" 2> /dev/null )"
|
|
shift
|
|
;;
|
|
index)
|
|
template="$(echo "" | pandoc --template=templates/blog.html \
|
|
-f markdown -t html5 -M frontpage 2> /dev/null )"
|
|
;;
|
|
esac
|
|
|
|
shift
|
|
|
|
|
|
echo "$template" | sed -n '1,/#CONTENT#/p' | head -n -1
|
|
|
|
for i in "$@"; do
|
|
case "$i" in
|
|
tmp/intros/*) cat "$i" ;;
|
|
esac
|
|
done
|
|
|
|
echo "$template" | sed -n '/#CONTENT#/,$p' | sed '1d'
|