Change the Labs section's pagination to be within the section:

```
--- a/layouts/labs/single.html
+++ b/layouts/labs/single.html
@@ -21,11 +21,11 @@
   </main>

   <nav class="pagination">
-    {{ if .Next }}
-      <span class="previous">&larr; <a href="{{ .Next.Permalink }}" rel="prev">{{ .Next.Title }}</a></span>
+    {{ with .PrevInSection }}
+    <span class="previous">&larr; <a href="{{ .Permalink }}" rel="prev">{{ .Title }}</a></span>
     {{ end }}
-    {{ if .Prev }}
-      <span class="next"><a href="{{ .Prev.Permalink }}" rel="next">{{ .Prev.Title }}</a> &rarr;</span>
+    {{ with .NextInSection }}
+    <span class="next"><a href="{{ .Permalink }}" rel="next">{{ .Title }}</a> &rarr;</span>
     {{ end }}
   </nav>
```
This commit is contained in:
Kazuhiro MUSASHI 2019-04-14 18:50:43 +08:00
parent e7f7fa7efd
commit 746c5079d0
1 changed files with 4 additions and 4 deletions

View File

@ -21,11 +21,11 @@
</main> </main>
<nav class="pagination"> <nav class="pagination">
{{ if .Next }} {{ with .PrevInSection }}
<span class="previous">&larr; <a href="{{ .Next.Permalink }}" rel="prev">{{ .Next.Title }}</a></span> <span class="previous">&larr; <a href="{{ .Permalink }}" rel="prev">{{ .Title }}</a></span>
{{ end }} {{ end }}
{{ if .Prev }} {{ with .NextInSection }}
<span class="next"><a href="{{ .Prev.Permalink }}" rel="next">{{ .Prev.Title }}</a> &rarr;</span> <span class="next"><a href="{{ .Permalink }}" rel="next">{{ .Title }}</a> &rarr;</span>
{{ end }} {{ end }}
</nav> </nav>