summaryrefslogtreecommitdiffstats
path: root/_build
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-09-14 13:46:37 +0200
committerLoïc Hoguin <[email protected]>2016-09-14 13:46:37 +0200
commit62f5d70836fe9a211ebfe9551bf02f67049cf86c (patch)
tree40ee9d5acc42d4953ca5d04212d364728ad91ce5 /_build
parentd354fdf0fa439d9e403cec498c1318ffc9f61a41 (diff)
downloadninenines.eu-62f5d70836fe9a211ebfe9551bf02f67049cf86c.tar.gz
ninenines.eu-62f5d70836fe9a211ebfe9551bf02f67049cf86c.tar.bz2
ninenines.eu-62f5d70836fe9a211ebfe9551bf02f67049cf86c.zip
Add prev/next links at the bottom of user guide pages
Diffstat (limited to '_build')
-rw-r--r--_build/Makefile5
-rw-r--r--_build/themes/ninenines/layouts/docs/single.html21
2 files changed, 25 insertions, 1 deletions
diff --git a/_build/Makefile b/_build/Makefile
index 54fa7db2..cd8240e6 100644
--- a/_build/Makefile
+++ b/_build/Makefile
@@ -41,19 +41,22 @@ docs-$1-$2: tmp/$1
| sed -n '/^= /,$$$$p' \
| sed -n '/^$$$$/,$$$$p' \
| sed 's/^= /== /' >> content/docs/en/$1/$3/guide.asciidoc; \
- rm tmp/$1/doc/src/guide/book.asciidoc; \
+ mv tmp/$1/doc/src/guide/book.asciidoc tmp/$1/doc/src/guide/book.asciidoc.bak; \
for f in tmp/$1/doc/src/guide/*.asciidoc; do \
printf "%s\n" "+++" "project = \"$1\"" "version = \"$3\"" "doctype = \"guide\"" \
> content/docs/en/$1/$3/guide/`basename $$$$f`; \
echo -n "title = \"" >> content/docs/en/$1/$3/guide/`basename $$$$f`; \
echo -n `sed -n '1,/^== .*/ s/^== //p' $$$$f` >> content/docs/en/$1/$3/guide/`basename $$$$f`; \
echo "\"" >> content/docs/en/$1/$3/guide/`basename $$$$f`; \
+ echo -n "weight = " >> content/docs/en/$1/$3/guide/`basename $$$$f`; \
+ echo "`cat tmp/$1/doc/src/guide/book.asciidoc.bak | grep ^include:: | sed 's/include::\(.*.asciidoc\).*/\1/'` :`basename $$$$f`" | tr '\n' ' ' | awk -F: '{print index($$$$1, $$$$2)}' >> content/docs/en/$1/$3/guide/`basename $$$$f`; \
echo "+++" >> content/docs/en/$1/$3/guide/`basename $$$$f`; \
echo >> content/docs/en/$1/$3/guide/`basename $$$$f`; \
sed '1,/^$$$$/d' $$$$f | sed 's/^=== /== /' \
| sed 's/xref:/link:..\//' | sed 's/image::/image::..\//' \
>> content/docs/en/$1/$3/guide/`basename $$$$f`; \
done; \
+ rm tmp/$1/doc/src/guide/book.asciidoc.bak; \
mkdir -p static/docs/en/$1/$3/guide/; \
cp tmp/$1/doc/src/guide/* static/docs/en/$1/$3/guide/; \
fi
diff --git a/_build/themes/ninenines/layouts/docs/single.html b/_build/themes/ninenines/layouts/docs/single.html
index b3eeefcd..4bef64ca 100644
--- a/_build/themes/ninenines/layouts/docs/single.html
+++ b/_build/themes/ninenines/layouts/docs/single.html
@@ -10,6 +10,27 @@
{{ .Content }}
+{{ if .Weight }}
+ {{ if eq .Params.doctype "guide" }}
+ {{ $.Scratch.Set "prev" ((where (where (where $.Site.Pages ".Params.project" .Params.project) ".Params.doctype" .Params.doctype) ".Params.version" .Params.version).Prev .) }}
+ {{ $.Scratch.Set "next" ((where (where (where $.Site.Pages ".Params.project" .Params.project) ".Params.doctype" .Params.doctype) ".Params.version" .Params.version).Next .) }}
+
+ <nav style="margin:1em 0">
+ {{ if ($.Scratch.Get "prev").Weight }}
+ <a style="float:left" href="{{ ($.Scratch.Get "prev").Permalink }}">
+ {{ ($.Scratch.Get "prev").Title }}
+ </a>
+ {{ end }}
+
+ {{ if ($.Scratch.Get "next").Weight }}
+ <a style="float:right" href="{{ ($.Scratch.Get "next").Permalink }}">
+ {{ ($.Scratch.Get "next").Title }}
+ </a>
+ {{ end }}
+ </nav>
+ {{ end }}
+{{ end }}
+
<!-- a.code -->
</div>