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

github.com/saadnpq/npq-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyles Sappington <sugarmilkdawg@gmail.com>2020-05-14 21:01:28 +0300
committerMyles Sappington <sugarmilkdawg@gmail.com>2020-05-14 21:01:28 +0300
commit5286d164daef4770175bbc05c39768478749edcd (patch)
treedaa090d9ca2fb2a95481f3d90dc436c2f722b738
parentcd6e9195eda76d7c981f4d6af0b20e4446f8f0e8 (diff)
Added pages for list sites
-rw-r--r--layouts/_default/list.html5
-rw-r--r--layouts/partials/pagination.html32
-rw-r--r--static/css/style.css13
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;
}