Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/AngeloStavrow/indigo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelo Stavrow <angelo@fogcreek.com>2018-08-18 00:25:25 +0300
committerAngelo Stavrow <angelo@fogcreek.com>2018-08-18 00:25:25 +0300
commit4cff4ec90d8eb5f6e4ba7c3902f865516a21adeb (patch)
tree51071fcb02fe1e7a66d5e1591db5547949eee629
parentd1d3529dd3baae79d8ae61383871146481571409 (diff)
Add back older/newer links to nav
-rw-r--r--layouts/partials/pagenav.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/layouts/partials/pagenav.html b/layouts/partials/pagenav.html
index b332d49..c7e59ab 100644
--- a/layouts/partials/pagenav.html
+++ b/layouts/partials/pagenav.html
@@ -1,11 +1,18 @@
<nav>
+ {{ $currentPage := . }}
<div id="page-nav">
<!--
Left-most entry is a link to the next-newest article, if we're
looking at posts, or a spacer if we're either on the home page or a
menu-content page.
-->
+ {{ if and (.Prev) (not .Params.Menu) }}
+ <div class="static-page-nav-item">
+ <a alt="Newer article" href="{{ .Prev.Permalink }}">&larr; Newer</a>
+ </div>
+ {{ else }}
<div class="static-page-nav-spacer">&nbsp;</div>
+ {{ end }}
<!-- Next, the menu of static content pages (e.g., about, now). -->
<div class="static-page-nav-item">
@@ -25,7 +32,13 @@
looking at posts, or a spacer if we're either on the home page or a
menu-content page.
-->
+ {{ if and (.Next) (not .Params.Menu) }}
+ <div class="static-page-nav-item">
+ <a alt="Older article" href="{{ .Next.Permalink }}">Older &rarr;</a>
+ </div>
+ {{ else }}
<div class="static-page-nav-spacer">&nbsp;</div>
+ {{ end }}
</div>
</nav>