2024.7.23 修复分页bug
This commit is contained in:
1 parent
704393f80a
commit
2bf1a16008
5 files changed
+42
-48
No files matched your search
@@ -4,26 +4,25 @@
|
||||
<div class="recent-posts section">
|
||||
<h2 class="section-header">随笔<i class="ri-quill-pen-line"></i></h2>
|
||||
<div class="posts">
|
||||
{{ range .Paginator.Pages }}
|
||||
{{ if eq .Type "post" }}
|
||||
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "post") }}
|
||||
{{ range $paginator.Pages }}
|
||||
<div class="post">
|
||||
<div class="time">{{ .Date.Format "January 2, 2006" }}</div>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<ul class="pagination">
|
||||
<li class="page-item page-previous">
|
||||
{{ if .Paginator.HasPrev }}
|
||||
<a class="prev" title="上一页" href="{{ .Paginator.Prev.URL }}">上一页</a>
|
||||
{{ if $paginator.HasPrev }}
|
||||
<a class="prev" title="上一页" href="{{ $paginator.Prev.URL }}">上一页</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
<li class="page-item page-next">
|
||||
{{ if .Paginator.HasNext }}
|
||||
<a class="next" title="下一页" href="{{ .Paginator.Next.URL }}">下一页</a>
|
||||
{{ if $paginator.HasNext }}
|
||||
<a class="next" title="下一页" href="{{ $paginator.Next.URL }}">下一页</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -1,31 +1,25 @@
|
||||
{{ define "main" }}
|
||||
<div id="pjax-container">
|
||||
<article>
|
||||
<div class="recent-posts section">
|
||||
<h2 class="section-header">随笔<i class="ri-quill-pen-line"></i></h2>
|
||||
<div class="posts">
|
||||
{{ range .Paginator.Pages }}
|
||||
{{ if eq .Type "post" }}
|
||||
<div class="post">
|
||||
<div class="time">{{ .Date.Format "January 2, 2006" }}</div>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<article>
|
||||
<div class="post-list section">
|
||||
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "post") }}
|
||||
{{ range $paginator.Pages }}
|
||||
<div class="post">
|
||||
<div class="time">{{ .Date.Format "January 2, 2006" }}</div>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</div>
|
||||
</article>
|
||||
<ul class="pagination">
|
||||
<li class="page-item page-previous">
|
||||
{{ if .Paginator.HasPrev }}
|
||||
<a class="prev" title="上一页" href="{{ .Paginator.Prev.URL }}">上一页</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
<li class="page-item page-next">
|
||||
{{ if .Paginator.HasNext }}
|
||||
<a class="next" title="下一页" href="{{ .Paginator.Next.URL }}">下一页</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</article>
|
||||
<ul class="pagination">
|
||||
<li class="page-item page-previous">
|
||||
{{ if $paginator.HasPrev }}
|
||||
<a class="prev" title="上一页" href="{{ $paginator.Prev.URL }}">上一页</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
<li class="page-item page-next">
|
||||
{{ if $paginator.HasNext }}
|
||||
<a class="next" title="下一页" href="{{ $paginator.Next.URL }}">下一页</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
Reference in new issue
Block a user