shithub: hugo

Download patch

ref: acd5ea0e75cc577c55b80e40fc26ed7c2b66ea63
parent: eff8457ac91e337b81876271aca31bf4d61e09f1
author: Danilo Cabello <[email protected]>
date: Tue Aug 20 08:13:27 EDT 2013

Check .Prev and .Next pointers before using it

--- a/docs/content/layout/content.md
+++ b/docs/content/layout/content.md
@@ -65,8 +65,12 @@
         </ul>
         </div>
         <div>
-            <a class="previous" href="{{.Prev.Permalink}}"> {{.Prev.Title}}</a>
-            <a class="next" href="{{.Next.Permalink}}"> {{.Next.Title}}</a>
+            {{ if .Prev }}
+              <a class="previous" href="{{.Prev.Permalink}}"> {{.Prev.Title}}</a>
+            {{ end }}
+            {{ if .Next }}
+              <a class="next" href="{{.Next.Permalink}}"> {{.Next.Title}}</a>
+            {{ end }}
         </div>
     </aside>