web/scripts/web.sh
milovann 58d91e5207
All checks were successful
/ publish (push) Successful in 58s
up
2024-12-07 15:48:05 +01:00

44 lines
636 B
Bash
Executable file

#!/bin/bash
convert()
{
file=$1
filename=$(basename -- "$file")
extension="${filename##*.}"
filename="${filename%.*}"
if [[ -f ../pages/$filename.md ]]
then
echo "making $filename.html"
pandoc \
-s \
--verbose \
--template=templates/default.html \
--css=default.css \
../pages/$filename.md \
-t html > ../dist/$filename.html \
--lua-filter=links-to-html.lua
fi
}
batch()
{
files=$(ls ../pages)
for f in $files
do
echo "$f"
convert $f
done
}
# Linked files
cp templates/default.css ../dist
# Options
case $1 in
convert) shift 1; convert "$@";;
batch) batch ;;
*) echo "?" ;;
esac