mirror of
https://github.com/carsonip/hugo-theme-minos
synced 2025-12-30 03:19:49 -08:00
Add pagination
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
{{ partial "li.html" . }}
|
{{ partial "li.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div></section>
|
</div></section>
|
||||||
|
{{ partial "pagination.html" . }}
|
||||||
</section>
|
</section>
|
||||||
{{ partial "footer.html" . }}
|
{{ partial "footer.html" . }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div id="container">
|
<div id="container">
|
||||||
{{ partial "header.html" . }}
|
{{ partial "header.html" . }}
|
||||||
<section id="main" class="outer">
|
<section id="main" class="outer">
|
||||||
{{ range .Data.Pages }}
|
{{ range .Paginator.Pages }}
|
||||||
<article class="article article-type-post" itemscope itemprop="blogPost">
|
<article class="article article-type-post" itemscope itemprop="blogPost">
|
||||||
<div class="article-inner">
|
<div class="article-inner">
|
||||||
<!--<%- partial('post/gallery') %>-->
|
<!--<%- partial('post/gallery') %>-->
|
||||||
@@ -57,6 +57,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ partial "pagination.html" . }}
|
||||||
</section>
|
</section>
|
||||||
{{ partial "footer.html" . }}
|
{{ partial "footer.html" . }}
|
||||||
</div>
|
</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" . }}
|
{{ partial "li.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div></section>
|
</div></section>
|
||||||
|
{{ partial "pagination.html" . }}
|
||||||
</section>
|
</section>
|
||||||
{{ partial "footer.html" . }}
|
{{ partial "footer.html" . }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user