add template with home link

add index page
master
quenousimporte 2 months ago
parent eaee0782d7
commit 39ee428fff

17
st.sh

@ -1,11 +1,20 @@
input=.
output=./out
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##*/}
sed 's/\[\[\(.*\)\]\]/\[\1\](\1.html)/g' "$input/$f" | pandoc -f $outformat --metadata title="${f%.md}" --standalone --css=style.css -o "$output/${f%.md}.html"
done
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

@ -1,3 +1,3 @@
body {
font-family: helvetica
}
body {
font-family: helvetica
}

@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>$title$</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div>
<a href="index.html">Home</a>&nbsp;
</div>
<hr>
$body$
</body>
</html>
Loading…
Cancel
Save