diff options
author | Darshan Baral <darshanbaral@gmail.com> | 2019-05-20 01:09:37 +0300 |
---|---|---|
committer | Darshan Baral <darshanbaral@gmail.com> | 2019-05-20 01:09:37 +0300 |
commit | 71ac63966ec6e736032587dc6ca659c1662fd58a (patch) | |
tree | e061ca0211c9afa0512cfe217aa7fb6a3e2944b0 | |
parent | 860dd7bebb4aeee1c7ab18e891947275aa15b2e2 (diff) |
Added next/previous for single pages
-rw-r--r-- | layouts/_default/single.html | 9 | ||||
-rw-r--r-- | layouts/partials/nextChapter.html | 10 | ||||
-rw-r--r-- | layouts/partials/previousChapter.html | 10 |
3 files changed, 27 insertions, 2 deletions
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" }}
-<div>
+<div class="mb-4">
+ <small>{{ partial "previousChapter" . }}</small>
<h2>{{ .Title }}</h2>
<div class="ml-4 border-left border-primary pl-1">
{{ .Content }}
+ <div class="d-flex flex-row justify-content-around border-top pt-2 border-primary">
+ {{ partial "previousChapter" . }}
+ {{ partial "nextChapter" . }}
+ </div>
</div>
<div class="toTop navMenu menuItem" onclick="scrollToTop()">
- <i class="fas fa-angle-up"></i>
+ <i class="fas fa-angle-up"></i>
</div>
</div>
{{ 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 }} +<div> + <a + href="{{ .PrevInSection.Permalink | relURL }}" + title="{{ .PrevInSection.Title }}" + > + Next Chapter > + </a> +</div> +{{ 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 }} +<div> + <a + href="{{ .NextInSection.Permalink | relURL }}" + title="{{ .NextInSection.Title }}" + > + < Previous Chapter + </a> +</div> +{{ end }} |