Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/tummychow/lanyon-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Jung <tummychow@users.noreply.github.com>2015-10-23 20:25:15 +0300
committerStephen Jung <tummychow@users.noreply.github.com>2015-10-23 20:25:15 +0300
commitf970b59d48a8dd168d4b22b495d32d08ef81c7e7 (patch)
treea837f82b1730fd15ff2d3446c4e6351ea9e1972c
parent15f399bfabfdbe033895ba0c6005d794aa1f788f (diff)
parent538f120191dea41da90a6da4e9462a3833204d5a (diff)
Merge pull request #10 from nithinphilips/master
-rwxr-xr-x[-rw-r--r--]layouts/index.html27
1 files changed, 11 insertions, 16 deletions
diff --git a/layouts/index.html b/layouts/index.html
index babc481..dfb3889 100644..100755
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,34 +1,29 @@
{{ partial "default_head.html" . }}
-{{ $pagination := 5 }}
+<!-- Space delimited list of page types -->
+{{ $paginator := .Paginate (where .Data.Pages "Type" "in" "post") }}
<div class="posts">
- {{ range first $pagination .Data.Pages }}
- {{ if eq .Type "post"}}
- <div class="post">
+ {{ range .Paginator.Pages }}
+ <div class="post">
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<span class="post-date">{{ .Date.Format .Site.Params.DateForm }}</span>
{{ .Content }}
- </div>
- {{ end }}
+ </div>
{{ end }}
</div>
<div class="pagination">
- {{ if false }}
- <a class="pagination-item older" href="/page2">Older</a>
+ {{ if $paginator.HasNext }}
+ <a class="pagination-item older" href="{{ $paginator.Next.URL }}">Older</a>
{{ else }}
- <span class="pagination-item older">Older</span>
+ <span class="pagination-item older">Older</span>
{{ end }}
- {{ if false }}
- {{ if false }}
- <a class="pagination-item newer" href="/">Newer</a>
- {{ else }}
- <a class="pagination-item newer" href="/page1">Newer</a>
- {{ end }}
+ {{ if $paginator.HasPrev }}
+ <a class="pagination-item newer" href="{{ $paginator.Prev.URL }}">Newer</a>
{{ else }}
- <span class="pagination-item newer">Newer</span>
+ <span class="pagination-item newer">Newer</span>
{{ end }}
</div>