21 lines
673 B
Bash
21 lines
673 B
Bash
input=$1
|
|
output=$input/out
|
|
outformat=markdown+hard_line_breaks+autolink_bare_uris+lists_without_preceding_blankline
|
|
index=$output/index.html
|
|
|
|
rm -rf $output/*
|
|
|
|
cp style.css $output/style.css
|
|
echo '<!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" href="style.css"></head><body><div><a href="index.html">Home</a></div><hr>' >> $index
|
|
|
|
for f in $input/*.md
|
|
do
|
|
f=${f##*/}
|
|
title=${f%.md}
|
|
|
|
sed 's/\[\[\(.*\)\]\]/\[\1\](\1.html)/g' "$input/$f" | pandoc -f $outformat --metadata title="$title" --template template.html --standalone -o "$output/${title}.html"
|
|
echo "<div><a href=\"$title.html\">$title</a></div>" >> $index
|
|
done
|
|
|
|
echo '</body></html>' >> $index
|