fix(paginate): paginate error for empty content (#350)
This commit is contained in:
@@ -10,25 +10,27 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
{{- /* Paginate */ -}}
|
{{- /* Paginate */ -}}
|
||||||
{{- $pages := .Pages.GroupByDate "2006" -}}
|
{{- if .Pages -}}
|
||||||
{{- with .Site.Params.section.paginate | default .Site.Params.paginate -}}
|
{{- $pages := .Pages.GroupByDate "2006" -}}
|
||||||
{{- $pages = $.Paginate $pages . -}}
|
{{- with .Site.Params.section.paginate | default .Site.Params.paginate -}}
|
||||||
{{- else -}}
|
{{- $pages = $.Paginate $pages . -}}
|
||||||
{{- $pages = .Paginate $pages -}}
|
{{- else -}}
|
||||||
{{- end -}}
|
{{- $pages = .Paginate $pages -}}
|
||||||
{{- range $pages.PageGroups -}}
|
|
||||||
<h3 class="group-title">{{ .Key }}</h3>
|
|
||||||
{{- range .Pages -}}
|
|
||||||
<article class="archive-item">
|
|
||||||
<a href="{{ .RelPermalink }}" class="archive-item-link">
|
|
||||||
{{- .Title -}}
|
|
||||||
</a>
|
|
||||||
<span class="archive-item-date">
|
|
||||||
{{- .Date.Format ($.Site.Params.section.dateFormat | default "01-02") -}}
|
|
||||||
</span>
|
|
||||||
</article>
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- range $pages.PageGroups -}}
|
||||||
|
<h3 class="group-title">{{ .Key }}</h3>
|
||||||
|
{{- range .Pages -}}
|
||||||
|
<article class="archive-item">
|
||||||
|
<a href="{{ .RelPermalink }}" class="archive-item-link">
|
||||||
|
{{- .Title -}}
|
||||||
|
</a>
|
||||||
|
<span class="archive-item-date">
|
||||||
|
{{- .Date.Format ($.Site.Params.section.dateFormat | default "01-02") -}}
|
||||||
|
</span>
|
||||||
|
</article>
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- partial "paginator.html" . -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- partial "paginator.html" . -}}
|
|
||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- /* Posts */ -}}
|
{{- /* Posts */ -}}
|
||||||
{{- if ne .Site.Params.home.posts.enable false -}}
|
{{- if ne .Site.Params.home.posts.enable false | and .Site.RegularPages -}}
|
||||||
{{- /* Paginate */ -}}
|
{{- /* Paginate */ -}}
|
||||||
{{- $pages := where .Site.RegularPages "Type" "posts" -}}
|
{{- $pages := where .Site.RegularPages "Type" "posts" -}}
|
||||||
{{- if .Site.Params.page.hiddenFromHomePage -}}
|
{{- if .Site.Params.page.hiddenFromHomePage -}}
|
||||||
|
|||||||
@@ -17,25 +17,27 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
{{- /* Paginate */ -}}
|
{{- /* Paginate */ -}}
|
||||||
{{- $pages := .Pages.GroupByDate "2006" -}}
|
{{- if .Pages -}}
|
||||||
{{- with .Site.Params.list.paginate | default .Site.Params.paginate -}}
|
{{- $pages := .Pages.GroupByDate "2006" -}}
|
||||||
{{- $pages = $.Paginate $pages . -}}
|
{{- with .Site.Params.list.paginate | default .Site.Params.paginate -}}
|
||||||
{{- else -}}
|
{{- $pages = $.Paginate $pages . -}}
|
||||||
{{- $pages = .Paginate $pages -}}
|
{{- else -}}
|
||||||
{{- end -}}
|
{{- $pages = .Paginate $pages -}}
|
||||||
{{- range $pages.PageGroups -}}
|
|
||||||
<h3 class="group-title">{{ .Key }}</h3>
|
|
||||||
{{- range .Pages -}}
|
|
||||||
<article class="archive-item">
|
|
||||||
<a href="{{ .RelPermalink }}" class="archive-item-link">
|
|
||||||
{{- .Title -}}
|
|
||||||
</a>
|
|
||||||
<span class="archive-item-date">
|
|
||||||
{{- .Date.Format ($.Site.Params.list.dateFormat | default "01-02") -}}
|
|
||||||
</span>
|
|
||||||
</article>
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- range $pages.PageGroups -}}
|
||||||
|
<h3 class="group-title">{{ .Key }}</h3>
|
||||||
|
{{- range .Pages -}}
|
||||||
|
<article class="archive-item">
|
||||||
|
<a href="{{ .RelPermalink }}" class="archive-item-link">
|
||||||
|
{{- .Title -}}
|
||||||
|
</a>
|
||||||
|
<span class="archive-item-date">
|
||||||
|
{{- .Date.Format ($.Site.Params.list.dateFormat | default "01-02") -}}
|
||||||
|
</span>
|
||||||
|
</article>
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- partial "paginator.html" . -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- partial "paginator.html" . -}}
|
|
||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user