about summary refs log tree commit diff homepage
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/main.go b/main.go
index c60be5b..4dbf016 100644
--- a/main.go
+++ b/main.go
@@ -137,10 +137,19 @@ func main() {
 				pages = append(pages, Page{i, f.Name})
 			}
 		}
+
+		prev := "";
+		if index > 0 {
+			prev = entries[index-1].Name()
+		}
+		next := "";
+		if index < len(entries) - 1 {
+			next = entries[index+1].Name()
+		}
 		t.ExecuteTemplate(w, "archive.html", Archive{
 			stat.Name(),
-			template.URL(entries[index-1].Name()),
-			template.URL(entries[index+1].Name()),
+			template.URL(prev),
+			template.URL(next),
 			pages,
 		})
 	})