diff options
author | Alyssa Rosenzweig <alyssa@rosenzweig.io> | 2017-04-04 19:28:32 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <alyssa@rosenzweig.io> | 2017-04-04 19:28:32 -0700 |
commit | c44c1ae113723673e20983a42802243951a3f016 (patch) | |
tree | d2cdae21d135e60a980ba4d8ac4c34fa4ecf5de0 /www/publish.sh | |
parent | 50d1e509db50452498f193ea7dac9060664a3833 (diff) | |
download | librebootfr-c44c1ae113723673e20983a42802243951a3f016.tar.gz librebootfr-c44c1ae113723673e20983a42802243951a3f016.zip |
Bad indexing with templates
Diffstat (limited to 'www/publish.sh')
-rwxr-xr-x | www/publish.sh | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/www/publish.sh b/www/publish.sh index c8838f17..1039e0eb 100755 --- a/www/publish.sh +++ b/www/publish.sh @@ -5,14 +5,18 @@ FILE=${1%.md} cat $1 > temp.md -# add footer - -echo '' >> temp.md - if [ "${FILE}" != "./index" ]; then - echo -ne '[Back to home](/index.html) -- ' >> temp.md + if [[ $FILE == *index ]] + then + DEST=".." + else + DEST="index.html" + fi + + RETURN="<a href='$DEST'>Back to previous index</a>" fi +echo "" >> temp.md echo "[License](license.md)" >> temp.md # change out .md -> .html @@ -25,4 +29,4 @@ TOC=$(grep -q "^x-toc-enable: true$" temp.md && echo "--toc --toc-depth=2") SMART=$(pandoc -v | grep -q '2\.0' || echo "--smart") # chuck through pandoc -pandoc $TOC $SMART temp.md -s --css /global.css -T Libreboot > $FILE.html +pandoc $TOC $SMART temp.md -s --css /global.css -T Libreboot --template template.html --metadata return="$RETURN"> $FILE.html |