aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xwww/publish.sh4
-rw-r--r--www/template.html67
3 files changed, 70 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index a59d0c9a..4c651ab6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,4 +40,5 @@ push
/gm45macaddress
tocheck*
*.html
+!www/template.html
/www/temp.md
diff --git a/www/publish.sh b/www/publish.sh
index dadb83e0..efe3249d 100755
--- a/www/publish.sh
+++ b/www/publish.sh
@@ -8,7 +8,7 @@ head -n 4 $FILE.md > temp.md
# if not homepage, add a link back to the homepage
if [ "${FILE}" != "./index" ]; then
- printf "[Go back to homepage](/index.md)\n\n" >> temp.md
+ RETURN="<p><a href='/index.md'>Go back to homepage</a></p>"
fi
# read rest of file
@@ -30,4 +30,4 @@ TOC=$(grep -q "^x-toc-enable: true$" temp.md && echo "--toc")
SMART=$(pandoc -v | grep -q '2\.0' || echo "--smart")
# chuck through pandoc
-pandoc $SMART temp.md -s --css /global.css --section-divs -T Libreboot $TOC > $FILE.html
+pandoc $SMART temp.md -s --css /global.css --section-divs -T Libreboot $TOC --template=template.html --metadata "return=$RETURN" > $FILE.html
diff --git a/www/template.html b/www/template.html
new file mode 100644
index 00000000..2fc9b28d
--- /dev/null
+++ b/www/template.html
@@ -0,0 +1,67 @@
+<!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$
+$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>