aboutsummaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rwxr-xr-xwww/generate.sh1
-rwxr-xr-xwww/publish.sh32
-rw-r--r--www/rsync.md4
-rw-r--r--www/template.html70
4 files changed, 100 insertions, 7 deletions
diff --git a/www/generate.sh b/www/generate.sh
index dab39ede..27d2a74b 100755
--- a/www/generate.sh
+++ b/www/generate.sh
@@ -1,2 +1,3 @@
#!/bin/bash
+find -L . -name '*.html' -and -not -name 'template.html' -delete
find -L . -name '*.md' -exec ./publish.sh {} \;
diff --git a/www/publish.sh b/www/publish.sh
index c8838f17..a5e3be2a 100755
--- a/www/publish.sh
+++ b/www/publish.sh
@@ -1,18 +1,37 @@
#!/bin/bash
+#
+# Copyright (C) 2017 Alyssa Rosenzweig <alyssa@rosenzweig.io
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
echo $1
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 +44,5 @@ 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/rsync.md b/www/rsync.md
index f89b5a3c..550cff80 100644
--- a/www/rsync.md
+++ b/www/rsync.md
@@ -1,4 +1,6 @@
-% Mirroring libreboot
+---
+title: Mirroring libreboot
+...
Create a directory in your web directory (e.g. libreboot/) and put one
of these in your crontab:
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>