parent
eaee0782d7
commit
39ee428fff
15
st.sh
15
st.sh
|
@ -1,11 +1,20 @@
|
||||||
input=.
|
input=$1
|
||||||
output=./out
|
output=$input/out
|
||||||
outformat=markdown+hard_line_breaks+autolink_bare_uris+lists_without_preceding_blankline
|
outformat=markdown+hard_line_breaks+autolink_bare_uris+lists_without_preceding_blankline
|
||||||
|
index=$output/index.html
|
||||||
|
|
||||||
rm -rf $output/*
|
rm -rf $output/*
|
||||||
|
|
||||||
cp style.css $output/style.css
|
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
|
for f in $input/*.md
|
||||||
do
|
do
|
||||||
f=${f##*/}
|
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"
|
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
|
done
|
||||||
|
|
||||||
|
echo '</body></html>' >> $index
|
||||||
|
|
|
@ -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>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
$body$
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue