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

github.com/Tazeg/hugo-blog-jeffprod.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTazeg <jeffgazet@gmail.com>2018-08-11 12:32:31 +0300
committerTazeg <jeffgazet@gmail.com>2018-08-11 12:32:31 +0300
commitc45447aada4e5aeb65a8b1718e44495878a23a1e (patch)
treec7b521e5d065fbf6c7b4b83e0ed5227a274f2f66
parent23f4a045d4504511c7eea28d0b68d1bba284bf47 (diff)
Added pagination to home page
-rw-r--r--layouts/index.html19
-rw-r--r--theme.toml2
2 files changed, 18 insertions, 3 deletions
diff --git a/layouts/index.html b/layouts/index.html
index c60633a..38d869c 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,5 +1,5 @@
{{ define "main" }}
-
+{{ $paginator := .Paginate (where .Site.Pages "Type" "article").ByPublishDate.Reverse }}
<div class="container">
<div class="columns">
<div class="column is-9">
@@ -7,7 +7,7 @@
<div class="content">
<h3>Welcome to my blog !</h3>
<hr>
- {{ range first 5 (where .Site.Pages "Type" "article").ByPublishDate.Reverse }}
+ {{ range $paginator.Pages }}
<article class="media">
<div class="media-content">
<div class="content">
@@ -29,6 +29,21 @@
{{ partial "widget-archives.html" . }}
</div>
</div>
+ <div class="columns">
+ <div class="column is-9">
+ <nav class="pagination is-centered is-rounded" role="navigation" aria-label="pagination">
+ {{ if $paginator.HasPrev }}<a class="pagination-previous" href="{{ $paginator.Prev.URL }}">Previous</a>{{ end }}
+ {{ if $paginator.HasNext }}<a class="pagination-next" href="{{ $paginator.Next.URL }}">Next</a>{{ end }}
+ <ul class="pagination-list">
+ {{ range $paginator.Pagers }}
+ <li class="pagination__item">
+ <a class="pagination-link{{ if eq . $paginator }} is-current{{ end }}" aria-label="Goto page {{ .PageNumber }}" href="{{ .URL }}">{{ .PageNumber }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ </nav>
+ </div>
+ </div>
</div>
{{ end }}
diff --git a/theme.toml b/theme.toml
index ef196f4..d78c845 100644
--- a/theme.toml
+++ b/theme.toml
@@ -6,7 +6,7 @@ license = "MIT"
licenselink = "https://github.com/Tazeg/hugo-blog-jeffprod/blob/master/LICENSE"
description = "A new theme blog for HUGO built with Bulma CSS. Including archives and tags widgets."
homepage = "https://github.com/Tazeg/hugo-blog-jeffprod"
-tags = ["blog","archives","theme","tags","bulma","simple","personal"]
+tags = ["simple","blog","theme","pagination","archives","tags","bulma","personal"]
features = []
min_version = "0.41"