修复置顶文章bug
This commit is contained in:
1 parent
598fd02885
commit
34dad82f75
2 files changed
+3
-3
No files matched your search
@@ -4,7 +4,6 @@
|
|||||||
{{ $currentYear := 0 }}
|
{{ $currentYear := 0 }}
|
||||||
{{ $currentMonth := 0 }}
|
{{ $currentMonth := 0 }}
|
||||||
{{ range .Site.RegularPages }}
|
{{ range .Site.RegularPages }}
|
||||||
<!-- {{ if and (eq .Type "post") (ne .Params.status "hidden") }} -->
|
|
||||||
{{ if eq .Type "post" }}
|
{{ if eq .Type "post" }}
|
||||||
{{ $year := .Date.Year }}
|
{{ $year := .Date.Year }}
|
||||||
{{ $month := .Date.Month }}
|
{{ $month := .Date.Month }}
|
||||||
@@ -27,6 +26,7 @@
|
|||||||
<h3 class="diy-h3" uk-scrollspy="cls: uk-animation-slide-bottom-small; repeat: false" data-toggle="collapse"
|
<h3 class="diy-h3" uk-scrollspy="cls: uk-animation-slide-bottom-small; repeat: false" data-toggle="collapse"
|
||||||
data-target="#collapse{{ $year }}{{ printf "%02d" $month }}" aria-expanded="false"
|
data-target="#collapse{{ $year }}{{ printf "%02d" $month }}" aria-expanded="false"
|
||||||
aria-controls="collapse{{ $year }}{{ printf "%02d" $month }}">
|
aria-controls="collapse{{ $year }}{{ printf "%02d" $month }}">
|
||||||
|
|
||||||
{{ $month | printf "%02d" }}月
|
{{ $month | printf "%02d" }}月
|
||||||
</h3>
|
</h3>
|
||||||
<div class="collapse" id="collapse{{ $year }}{{ printf "%02d" $month }}"
|
<div class="collapse" id="collapse{{ $year }}{{ printf "%02d" $month }}"
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
<div class="recent-posts section">
|
<div class="recent-posts section">
|
||||||
<h2 class="section-header">随笔<i class="ri-quill-pen-line"></i></h2>
|
<h2 class="section-header">随笔<i class="ri-quill-pen-line"></i></h2>
|
||||||
<div class="posts">
|
<div class="posts">
|
||||||
<!-- 使用 ByWeight 来排序 -->
|
<!-- 使用 sort 对文章按 Weight 排序 -->
|
||||||
{{ $posts := where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden" | sort "Weight" "asc" }}
|
{{ $posts := sort (where (where .Site.RegularPages "Type" "post") "Params.status" "ne" "hidden") "Weight" }}
|
||||||
{{ $paginator := .Paginate $posts }}
|
{{ $paginator := .Paginate $posts }}
|
||||||
|
|
||||||
{{ range $paginator.Pages }}
|
{{ range $paginator.Pages }}
|
||||||
|
|||||||
Reference in new issue
Block a user