Add pagination
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
{{ partial "li.html" . }}
|
||||
{{ end }}
|
||||
</div></section>
|
||||
{{ partial "pagination.html" . }}
|
||||
</section>
|
||||
{{ partial "footer.html" . }}
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div id="container">
|
||||
{{ partial "header.html" . }}
|
||||
<section id="main" class="outer">
|
||||
{{ range .Data.Pages }}
|
||||
{{ range .Paginator.Pages }}
|
||||
<article class="article article-type-post" itemscope itemprop="blogPost">
|
||||
<div class="article-inner">
|
||||
<!--<%- partial('post/gallery') %>-->
|
||||
@@ -57,6 +57,8 @@
|
||||
</div>
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
</section>
|
||||
{{ partial "footer.html" . }}
|
||||
</div>
|
||||
|
||||
19
layouts/partials/pagination.html
Normal file
19
layouts/partials/pagination.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{{ $pag := $.Paginator }}
|
||||
{{ if gt $pag.TotalPages 1 }}
|
||||
<nav id="page-nav">
|
||||
{{ if $pag.HasPrev }}
|
||||
<a href="{{ $pag.Prev.URL }}" rel="prev" class="extend prev">« Prev</a>
|
||||
{{ end }}
|
||||
{{ range $pag.Pagers }}
|
||||
{{ if eq . $pag }}
|
||||
<span class="page-number current">{{ $pag.PageNumber }}</span>
|
||||
{{ else }}
|
||||
<a href="{{ .URL }}">{{ .PageNumber }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $pag.HasNext }}
|
||||
<a href="{{ $pag.Next.URL }}" rel="next" class="extend next">Next »</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
{{ end }}
|
||||
@@ -12,6 +12,7 @@
|
||||
{{ partial "li.html" . }}
|
||||
{{ end }}
|
||||
</div></section>
|
||||
{{ partial "pagination.html" . }}
|
||||
</section>
|
||||
{{ partial "footer.html" . }}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user