From 71ac63966ec6e736032587dc6ca659c1662fd58a Mon Sep 17 00:00:00 2001 From: Darshan Baral Date: Sun, 19 May 2019 15:09:37 -0700 Subject: Added next/previous for single pages --- layouts/_default/single.html | 9 +++++++-- layouts/partials/nextChapter.html | 10 ++++++++++ layouts/partials/previousChapter.html | 10 ++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 layouts/partials/nextChapter.html create mode 100644 layouts/partials/previousChapter.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 42a93b7..43f55b4 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,11 +1,16 @@ {{ define "main" }} -
+
+ {{ partial "previousChapter" . }}

{{ .Title }}

{{ .Content }} +
+ {{ partial "previousChapter" . }} + {{ partial "nextChapter" . }} +
{{ end }} diff --git a/layouts/partials/nextChapter.html b/layouts/partials/nextChapter.html new file mode 100644 index 0000000..9d1d588 --- /dev/null +++ b/layouts/partials/nextChapter.html @@ -0,0 +1,10 @@ +{{ if .PrevInSection }} +
+ + Next Chapter > + +
+{{ end }} diff --git a/layouts/partials/previousChapter.html b/layouts/partials/previousChapter.html new file mode 100644 index 0000000..de0e7ec --- /dev/null +++ b/layouts/partials/previousChapter.html @@ -0,0 +1,10 @@ +{{ if .NextInSection }} +
+ + < Previous Chapter + +
+{{ end }} -- cgit v1.2.3