IMPROVEMENT: organize the list logic

This commit is contained in:
FarseaSH 2023-05-17 21:23:48 +08:00
parent 4b71d96e29
commit 3e3a45dde5
2 changed files with 3 additions and 3 deletions

View file

@ -1,4 +1,4 @@
<h1 align=center>Hugo 主题 Moments | <a href="https://farseash.github.io/demo-hugo-theme-moments">Demo</a></h1>
<h1 align=center>Hugo 主题 Moments | <a href="https://farseash.github.io/demo-hugo-theme-moments/moments">Demo</a></h1>
</br>

View file

@ -1,6 +1,6 @@
{{ define "main" }}
<div class="container">
{{ $paginator := .Paginate ((where .Site.RegularPages "Section" "moments").ByParam "top") }}
{{ $paginator := .Paginate (.Site.RegularPages.ByParam "top") }}
{{ range $paginator.Pages }}
{{ partial "row.html" . }}
{{ end }}
@ -12,7 +12,7 @@
{{ define "pagination" }}
{{ $paginator := .Paginate ((where .Site.RegularPages "Section" "moments").ByParam "top") }}
{{ $paginator := .Paginate (.Site.RegularPages.ByParam "top") }}
{{ if $paginator.HasPrev }}
<a class="page-link" href="{{$.Site.BaseURL}}/{{sub $paginator.PageNumber 1 }}">
<div class="page-item">< Prev</div>