修复分页bug
This commit is contained in:
1 parent
2bf1a16008
commit
50ec39d831
4 files changed
+39
-37
No files matched your search
@@ -1,42 +1,44 @@
|
||||
{{ define "main" }}
|
||||
<div id="pjax-container">
|
||||
{{/* <h1 class="post-title">{{ .Title }}</h1> */}}
|
||||
<div class="post-content" style="list-style-type: none;">
|
||||
{{ $currentYear := 0 }}
|
||||
{{ $currentMonth := 0 }}
|
||||
{{ range .Site.RegularPages }}
|
||||
{{ if eq .Type "post" }}
|
||||
{{ $year := .Date.Year }}
|
||||
{{ $month := .Date.Month }}
|
||||
{{ if ne $year $currentYear }}
|
||||
{{ with $currentYear }} {{ if ne $currentYear 0 }} </div> {{ end }} {{ end }}
|
||||
<div class="link-title a-title" uk-scrollspy="cls: uk-animation-slide-left-medium; repeat: false">
|
||||
<span>{{ $year }}</span>
|
||||
{{ if and (eq .Type "post") (ne .Params.status "hidden") }}
|
||||
{{ $year := .Date.Year }}
|
||||
{{ $month := .Date.Month }}
|
||||
{{ if ne $year $currentYear }}
|
||||
{{ with $currentYear }} {{ if ne $currentYear 0 }} </div> {{ end }} {{ end }}
|
||||
<div class="link-title a-title" uk-scrollspy="cls: uk-animation-slide-left-medium; repeat: false">
|
||||
<span>{{ $year }}</span>
|
||||
</div>
|
||||
{{ $currentYear = $year }}
|
||||
{{ $currentMonth = 0 }}
|
||||
{{ end }}
|
||||
{{ if ne $month $currentMonth }}
|
||||
{{ with $currentMonth }} {{ if ne $currentMonth 0 }} </div> {{ end }} {{ end }}
|
||||
<h3 class="diy-h3" uk-scrollspy="cls: uk-animation-slide-right-medium; repeat: false" data-toggle="collapse"
|
||||
data-target="#collapse{{ $year }}{{ printf "%02d" $month }}" aria-expanded="false"
|
||||
aria-controls="collapse{{ $year }}{{ printf "%02d" $month }}">
|
||||
{{ $month | printf "%02d" }}月
|
||||
</h3>
|
||||
<div class="collapse" id="collapse{{ $year }}{{ printf "%02d" $month }}"
|
||||
uk-scrollspy="cls: uk-animation-slide-right-medium; repeat: false">
|
||||
{{ $currentMonth = $month }}
|
||||
{{ end }}
|
||||
<li data-date="{{ $year }}{{ printf "%02d" $month }}{{ .Date.Day }}">
|
||||
<span class="articles_date_time">{{ .Date.Format "01/02" }}</span>
|
||||
<a class="a-archives" uk-scrollspy="cls: uk-animation-slide-left-medium; repeat: false"
|
||||
href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if ne $currentMonth 0 }}
|
||||
</div> <!-- Close last month -->
|
||||
{{ end }}
|
||||
{{ if ne $currentYear 0 }}
|
||||
</div> <!-- Close last year -->
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ $currentYear = $year }}
|
||||
{{ $currentMonth = 0 }}
|
||||
{{ end }}
|
||||
{{ if ne $month $currentMonth }}
|
||||
{{ with $currentMonth }} {{ if ne $currentMonth 0 }}
|
||||
</div> {{ end }} {{ end }}
|
||||
<h3 class="diy-h3" uk-scrollspy="cls: uk-animation-slide-right-medium; repeat: false" data-toggle="collapse"
|
||||
data-target="#collapse{{ $year }}{{ printf " %02d" $month }}" aria-expanded="false"
|
||||
aria-controls="collapse{{ $year }}{{ printf " %02d" $month }}">
|
||||
{{ $month | printf "%02d" }}月
|
||||
</h3>
|
||||
<div class="collapse" id="collapse{{ $year }}{{ printf " %02d" $month }}"
|
||||
uk-scrollspy="cls: uk-animation-slide-right-medium; repeat: false">
|
||||
{{ $currentMonth = $month }}
|
||||
{{ end }}
|
||||
<li data-date="{{ $year }}{{ printf " %02d" $month }}{{ .Date.Day }}">
|
||||
<span class="articles_date_time">{{ .Date.Format "01/02" }}</span>
|
||||
<a class="a-archives" uk-scrollspy="cls: uk-animation-slide-left-medium; repeat: false"
|
||||
href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if ne $currentMonth 0 }}
|
||||
</div> {{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
Reference in new issue
Block a user