Support pagination

Fixes #12
This commit is contained in:
BBaoVanC 2021-10-02 19:26:33 -05:00
parent 5613f8e6f1
commit c03c44ff2d
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
2 changed files with 37 additions and 1 deletions

View File

@ -96,3 +96,35 @@ ul.breadcrumb li+li:before {
ul.breadcrumb li.active a { ul.breadcrumb li.active a {
color: inherit; color: inherit;
} }
/* Pagination */
.pagination {
list-style: none;
text-align: center;
}
.page-item {
display: inline;
}
.page-link {
padding: 8px 16px;
border-radius: 5px;
color: lightgray;
}
.page-item.active .page-link {
background-color: #163b64;
color: inherit;
}
.page-item.active .page-link:hover {
background-color: #2b72c0;
color: white;
}
.page-link:hover {
background-color: #444;
color: white;
text-decoration: none;
}

View File

@ -8,7 +8,7 @@
<h1>{{ .Title | markdownify }}</h1> <h1>{{ .Title | markdownify }}</h1>
{{ end }} {{ end }}
{{ range .Pages }} {{ range .Paginator.Pages }}
<div class="post"> <div class="post">
<h2 class="post-title"> <h2 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
@ -53,4 +53,8 @@
</div> </div>
{{ end }} {{ end }}
<div class="pagination">
{{ template "_internal/pagination.html" . }}
</div>
{{ end }} {{ end }}