implement basic pagination

This commit is contained in:
John Bowdre 2023-11-13 10:05:14 -06:00
parent 5af0ab3937
commit 5457716248
3 changed files with 16 additions and 3 deletions

View file

@ -2,7 +2,7 @@ baseURL = "https://runtimeterror.dev"
theme = "risotto" theme = "risotto"
title = "runtimeterror" title = "runtimeterror"
copyright = "© 2018-2023 [runtimeterror](https://runtimeterror.dev)" copyright = "© 2018-2023 [runtimeterror](https://runtimeterror.dev)"
paginate = 3 paginate = 10
languageCode = "en" languageCode = "en"
DefaultContentLanguage = "en" DefaultContentLanguage = "en"
enableInlineShortcodes = true enableInlineShortcodes = true

View file

@ -11,7 +11,7 @@
{{ .Content }} {{ .Content }}
</header> </header>
{{ range $pages }} {{- range (.Paginate $pages).Pages }}
{{- $postDate := .Date.Format "2006-01-02" }} {{- $postDate := .Date.Format "2006-01-02" }}
{{- $updateDate := .Lastmod.Format "2006-01-02" }} {{- $updateDate := .Lastmod.Format "2006-01-02" }}
<article class="post"> <article class="post">
@ -27,4 +27,5 @@
</section> </section>
<br> <br>
</article> </article>
{{ end }} {{ end }}
{{- template "_internal/pagination.html" . }}

View file

@ -156,4 +156,16 @@ body.dark .notice {
position: relative; position: relative;
} }
/* pagination overrides */
ul.pagination li::marker {
content:'';
}
ul.pagination li {
margin: 0 0.25rem;
}
.pagination {
display:flex;
justify-content: center;
}