diff options
author | saad <saadnpq@yandex.com> | 2020-05-14 22:17:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 22:17:38 +0300 |
commit | c9a444da9f32c26848aa2f314186069d6f2d838c (patch) | |
tree | daa090d9ca2fb2a95481f3d90dc436c2f722b738 | |
parent | cd6e9195eda76d7c981f4d6af0b20e4446f8f0e8 (diff) | |
parent | 5286d164daef4770175bbc05c39768478749edcd (diff) |
Merge pull request #3 from legofarmer/master
Added pages for list sites
-rw-r--r-- | layouts/_default/list.html | 5 | ||||
-rw-r--r-- | layouts/partials/pagination.html | 32 | ||||
-rw-r--r-- | static/css/style.css | 13 |
3 files changed, 48 insertions, 2 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 9797c06..87a3427 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,7 +1,7 @@ {{ define "main" }} <div class="section"> <dev class="section-title">{{.Section}}</dev> - {{range .Pages}} + {{ range $index, $element := .Paginator.Pages }} <div class="list-item"> <a class="entry-title" href="{{ .URL }}">{{ .Title }}</a> {{$page := .}} @@ -21,4 +21,5 @@ </div> {{end}} </div> -{{end}}
\ No newline at end of file + {{ partial "pagination.html" $ }} +{{end}} diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..65e6c92 --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,32 @@ +{{ with $.Paginator }} +{{ if gt .TotalPages 1 }} +<ul class="pagination"> + {{ with .Prev }} + <li class="page-item"> + <a class="page-link" href="{{ .URL }}"> + <i class="fas fa-chevron-left"></i> + </a> + </li> + {{ else }} + <li class="page-item"> + <a class="grayed-out" href="javascript:void()"> + <i class="fas fa-chevron-left"></i> + </a> + </li> + {{ end }} + {{ with .Next }} + <li class="page-item"> + <a class="page-link" href="{{ .URL }}"> + <i class="fas fa-chevron-right"></i> + </a> + </li> + {{ else }} + <li class="page-item"> + <a class="grayed-out" href="javascript:void()"> + <i class="fas fa-chevron-right"></i> + </a> + </li> + {{ end }} +</ul> +{{ end }} +{{ end }} diff --git a/static/css/style.css b/static/css/style.css index 0fc9a65..9ca7dc8 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -283,6 +283,19 @@ blockquote { padding-top: 30px; border-top: 1px solid #3D3D3D; } + +ul.pagination { + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; + list-style-type: none; + font-size: 30px; + margin-top: 50px; + padding-top: 30px; + border-top: 1px solid #3D3D3D; +} + .nav-top:hover{ text-decoration: none; } |