From c44c1ae113723673e20983a42802243951a3f016 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 4 Apr 2017 19:28:32 -0700 Subject: Bad indexing with templates --- www/publish.sh | 16 ++++++++----- www/template.html | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 www/template.html 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="Back to previous index" 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 diff --git a/www/template.html b/www/template.html new file mode 100644 index 00000000..8e12e2aa --- /dev/null +++ b/www/template.html @@ -0,0 +1,70 @@ + + + + + + +$for(author-meta)$ + +$endfor$ +$if(date-meta)$ + +$endif$ +$if(keywords)$ + +$endif$ + $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ + +$if(quotes)$ + +$endif$ +$if(highlighting-css)$ + +$endif$ +$for(css)$ + +$endfor$ +$if(math)$ + $math$ +$endif$ + +$for(header-includes)$ + $header-includes$ +$endfor$ + + +$for(include-before)$ +$include-before$ +$endfor$ +$if(title)$ +
+

$title$

+$if(subtitle)$ +

$subtitle$

+$endif$ +$for(author)$ +

$author$

+$endfor$ +$if(date)$ +

$date$

+$endif$ +
+$endif$ +$if(return)$ +$return$ +$endif$ +$if(toc)$ + +$endif$ +$body$ +$for(include-after)$ +$include-after$ +$endfor$ + + -- cgit v1.2.3-70-g09d2