diff options
-rwxr-xr-x | www/publish.sh | 16 | ||||
-rw-r--r-- | www/template.html | 70 |
2 files changed, 80 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 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 @@ +<!DOCTYPE html> +<html$if(lang)$ lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$> +<head> + <meta charset="utf-8"> + <meta name="generator" content="pandoc"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> +$for(author-meta)$ + <meta name="author" content="$author-meta$"> +$endfor$ +$if(date-meta)$ + <meta name="dcterms.date" content="$date-meta$"> +$endif$ +$if(keywords)$ + <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$"> +$endif$ + <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title> + <style type="text/css">code{white-space: pre;}</style> +$if(quotes)$ + <style type="text/css">q { quotes: "“" "”" "‘" "’"; }</style> +$endif$ +$if(highlighting-css)$ + <style type="text/css"> +$highlighting-css$ + </style> +$endif$ +$for(css)$ + <link rel="stylesheet" href="$css$"> +$endfor$ +$if(math)$ + $math$ +$endif$ + <!--[if lt IE 9]> + <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> + <![endif]--> +$for(header-includes)$ + $header-includes$ +$endfor$ +</head> +<body> +$for(include-before)$ +$include-before$ +$endfor$ +$if(title)$ +<header> +<h1 class="title">$title$</h1> +$if(subtitle)$ +<p class="subtitle">$subtitle$</p> +$endif$ +$for(author)$ +<p class="author">$author$</p> +$endfor$ +$if(date)$ +<p class="date">$date$</p> +$endif$ +</header> +$endif$ +$if(return)$ +$return$ +$endif$ +$if(toc)$ +<nav id="$idprefix$TOC"> +$toc$ +</nav> +$endif$ +$body$ +$for(include-after)$ +$include-after$ +$endfor$ +</body> +</html> |