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

github.com/yursan9/manis-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYurizal Susanto <rizal.sagi@gmail.com>2017-07-03 05:38:25 +0300
committerYurizal Susanto <rizal.sagi@gmail.com>2017-07-03 05:38:25 +0300
commite1c90b6a2302056035acb2faf3df2849dd19ddad (patch)
treec88edcf51b4872c19c1f4c9b7eb25028058a1846 /layouts
parent08b54ed82077eb8ffbc0791dbe33cfb4a1e0cc36 (diff)
Rework list template to use paginator
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/list.html8
-rw-r--r--layouts/partials/paginator.html15
2 files changed, 17 insertions, 6 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 0ec93ff..8d04ea2 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -2,15 +2,11 @@
<section>
{{ partial "title" . }}
{{ with .Content }}{{.}}{{ end }}
-</section>
-{{ range .Pages.GroupByDate "Jan, 2006" }}
-<section>
- <h4>{{ .Key }}</h4>
<ul class="no-bullet">
- {{ range .Pages }}
+ {{ range .Paginator.Pages }}
{{ partial "li" . }}
{{ end }}
</ul>
+ {{ partial "paginator" . }}
</section>
-{{ end }}
{{ partial "footer" . }}
diff --git a/layouts/partials/paginator.html b/layouts/partials/paginator.html
new file mode 100644
index 0000000..bfd1f7a
--- /dev/null
+++ b/layouts/partials/paginator.html
@@ -0,0 +1,15 @@
+{{ if gt .Paginator.TotalPages 1 }}
+<nav class="pagination">
+ {{ with .Paginator.Prev }}
+ <a href="{{ .URL }}">
+ <img class="icon-text" src="/img/prev.svg"/>
+ </a>
+ {{ end }}
+ <span>{{.Paginator.PageNumber}}</span>
+ {{ with .Paginator.Next }}
+ <a href="{{ .URL }}">
+ <img class="icon-text" src="/img/next.svg"/>
+ </a>
+ {{ end }}
+</nav>
+{{ end }}