diff --git a/posts.go b/posts.go index d2159e0..a86847a 100644 --- a/posts.go +++ b/posts.go @@ -53,6 +53,7 @@ type indexTemplateData struct { Posts []*Post HasPrev bool HasNext bool + First string Prev string Next string } @@ -162,6 +163,7 @@ func serveIndex(path string, sec *section, tax *taxonomy, taxonomyValue string) Posts: posts, HasPrev: p.HasPrev(), HasNext: p.HasNext(), + First: path, Prev: fmt.Sprintf("%s/page/%d", path, prevPage), Next: fmt.Sprintf("%s/page/%d", path, nextPage), }) diff --git a/templates/index.gohtml b/templates/index.gohtml index 42b5d5d..8dfb014 100644 --- a/templates/index.gohtml +++ b/templates/index.gohtml @@ -1,12 +1,26 @@ {{ define "title" }} {{ blog.Title }} + + + {{ end }} {{ define "main" }}
{{ with .Title }}

{{ . }}

{{ end }} {{ with .Description }}{{ md . }}{{ end }} - {{ if (or .Title .Description) }}
{{ end }} + {{ if (or .Title .Description) }} +
+ {{ end }} {{ range $i, $post := .Posts }} {{ include "summary" . }} {{ end }}