web/scripts/web.sh
milovann 5ff9c3b39c
All checks were successful
/ publish (push) Successful in 57s
up
2024-12-06 15:59:26 +01:00

33 lines
483 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 --verbose -s ../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
}
case $1 in
convert) shift 1; convert "$@";;
batch) batch ;;
*) echo "?" ;;
esac