diff options
author | Angelo Stavrow <angelo@fogcreek.com> | 2018-08-18 00:25:25 +0300 |
---|---|---|
committer | Angelo Stavrow <angelo@fogcreek.com> | 2018-08-18 00:25:25 +0300 |
commit | 4cff4ec90d8eb5f6e4ba7c3902f865516a21adeb (patch) | |
tree | 51071fcb02fe1e7a66d5e1591db5547949eee629 | |
parent | d1d3529dd3baae79d8ae61383871146481571409 (diff) |
Add back older/newer links to nav
-rw-r--r-- | layouts/partials/pagenav.html | 13 |
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 }}">← Newer</a> + </div> + {{ else }} <div class="static-page-nav-spacer"> </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 →</a> + </div> + {{ else }} <div class="static-page-nav-spacer"> </div> + {{ end }} </div> </nav> |