aboutsummaryrefslogtreecommitdiff
path: root/www/publish.sh
diff options
context:
space:
mode:
authorLeah Rowe <info@minifree.org>2017-04-05 12:33:43 +0000
committerGogs <gogitservice@gmail.com>2017-04-05 12:33:43 +0000
commit5c5b7d947bd62a2b4bfbcfb856df31271e2b866f (patch)
tree4200d8c674d2f0351c68ccf15dfc38ef064ff32e /www/publish.sh
parenta81dbc79f5401d94954fa9efdcda093aa789d4b9 (diff)
parentaa529a3150d1a921c9a48854d89013476f85657a (diff)
downloadlibrebootfr-5c5b7d947bd62a2b4bfbcfb856df31271e2b866f.tar.gz
librebootfr-5c5b7d947bd62a2b4bfbcfb856df31271e2b866f.zip
Merge branch 'nav' of libreboot/libreboot into master
Diffstat (limited to 'www/publish.sh')
-rwxr-xr-xwww/publish.sh32
1 files changed, 26 insertions, 6 deletions
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