fix #314 - Archive page shows error when there are 0 posts
This commit is contained in:
parent
e09bbc6d4e
commit
842005439f
|
@ -114,3 +114,6 @@ other = "solarized"
|
||||||
|
|
||||||
[skin-kimbie]
|
[skin-kimbie]
|
||||||
other = "kimbie"
|
other = "kimbie"
|
||||||
|
|
||||||
|
[no-contents]
|
||||||
|
other = "Nothing to Display"
|
|
@ -113,4 +113,7 @@ other = "hacker"
|
||||||
other = "solarized"
|
other = "solarized"
|
||||||
|
|
||||||
[skin-kimbie]
|
[skin-kimbie]
|
||||||
other = "kimbie"
|
other = "kimbie"
|
||||||
|
|
||||||
|
[no-contents]
|
||||||
|
other = "Nothing to Display"
|
|
@ -113,4 +113,7 @@ other = "hacker"
|
||||||
other = "solarized"
|
other = "solarized"
|
||||||
|
|
||||||
[skin-kimbie]
|
[skin-kimbie]
|
||||||
other = "kimbie"
|
other = "kimbie"
|
||||||
|
|
||||||
|
[no-contents]
|
||||||
|
other = "Nothing to Display"
|
|
@ -114,3 +114,6 @@ other = "solarized"
|
||||||
|
|
||||||
[skin-kimbie]
|
[skin-kimbie]
|
||||||
other = "kimbie"
|
other = "kimbie"
|
||||||
|
|
||||||
|
[no-contents]
|
||||||
|
other = "Nothing to Display"
|
|
@ -113,4 +113,7 @@ other = "hacker"
|
||||||
other = "solarized"
|
other = "solarized"
|
||||||
|
|
||||||
[skin-kimbie]
|
[skin-kimbie]
|
||||||
other = "kimbie"
|
other = "kimbie"
|
||||||
|
|
||||||
|
[no-contents]
|
||||||
|
other = "Nothing to Display"
|
|
@ -113,4 +113,7 @@ other = "hacker"
|
||||||
other = "solarized"
|
other = "solarized"
|
||||||
|
|
||||||
[skin-kimbie]
|
[skin-kimbie]
|
||||||
other = "kimbie"
|
other = "kimbie"
|
||||||
|
|
||||||
|
[no-contents]
|
||||||
|
other = "Nothing to Display"
|
|
@ -113,4 +113,7 @@ other = "hacker"
|
||||||
other = "solarized"
|
other = "solarized"
|
||||||
|
|
||||||
[skin-kimbie]
|
[skin-kimbie]
|
||||||
other = "kimbie"
|
other = "kimbie"
|
||||||
|
|
||||||
|
[no-contents]
|
||||||
|
other = "Nothing to Display"
|
|
@ -114,3 +114,6 @@ other = "solarized"
|
||||||
|
|
||||||
[skin-kimbie]
|
[skin-kimbie]
|
||||||
other = "kimbie"
|
other = "kimbie"
|
||||||
|
|
||||||
|
[no-contents]
|
||||||
|
other = "Nothing to Display"
|
|
@ -113,4 +113,7 @@ other = "hacker"
|
||||||
other = "solarized"
|
other = "solarized"
|
||||||
|
|
||||||
[skin-kimbie]
|
[skin-kimbie]
|
||||||
other = "kimbie"
|
other = "kimbie"
|
||||||
|
|
||||||
|
[no-contents]
|
||||||
|
other = "Nothing to Display"
|
|
@ -16,27 +16,31 @@
|
||||||
{{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }}
|
{{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if gt (len $filteredPages) 0 }}
|
||||||
{{ $paginator := .Paginate ($filteredPages.GroupByDate ($.Param "archiveGroupByDate" | default "2006")) ($.Param "archivePaginate") }}
|
{{ $paginator := .Paginate ($filteredPages.GroupByDate ($.Param "archiveGroupByDate" | default "2006")) ($.Param "archivePaginate") }}
|
||||||
|
|
||||||
{{ range ($paginator).PageGroups }}
|
{{ range ($paginator).PageGroups }}
|
||||||
<span class="archive__key" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">{{ .Key }}</span>
|
<span class="archive__key" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">{{ .Key }}</span>
|
||||||
<ul class="archive__ul" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
|
<ul class="archive__ul" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
|
||||||
{{ range .Pages }}
|
{{ range .Pages }}
|
||||||
<li class="archive__li" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
|
<li class="archive__li" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
|
||||||
<span class="archive__meta" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">
|
<span class="archive__meta" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">
|
||||||
{{ if ne ($.Param "languagedir") "rtl" }}
|
{{ if ne ($.Param "languagedir") "rtl" }}
|
||||||
<span class="archive__type">{{ .Type }}</span>
|
<span class="archive__type">{{ .Type }}</span>
|
||||||
<span class="archive__date">{{ .Date.Format (i18n "archive-dateformat") }}</span>
|
<span class="archive__date">{{ .Date.Format (i18n "archive-dateformat") }}</span>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<span class="archive__date">{{ .Date.Format (i18n "archive-dateformat") }}</span>
|
<span class="archive__date">{{ .Date.Format (i18n "archive-dateformat") }}</span>
|
||||||
<span class="archive__type">{{ .Type }}</span>
|
<span class="archive__type">{{ .Type }}</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</span>
|
</span>
|
||||||
<a href="{{ .Permalink }}" class="archive__title" data-title-wrap="{{ $titleWrap | default "wrap"}}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">{{ .Title }}</a>
|
<a href="{{ .Permalink }}" class="archive__title" data-title-wrap="{{ $titleWrap | default "wrap"}}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">{{ .Title }}</a>
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ else }}
|
||||||
|
{{ i18n "no-contents" | default "There is nothing to display" }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="grow"></div>
|
<div class="grow"></div>
|
||||||
{{ partial "pagination/pagination" . }}
|
{{ partial "pagination/pagination" . }}
|
||||||
|
|
|
@ -17,34 +17,39 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<div class="archive__container">
|
<div class="archive__container">
|
||||||
{{ $pages := (where .Site.RegularPages "Section" "talks") }}
|
{{ $pages := (where .Site.RegularPages "Section" "talks") }}
|
||||||
{{ $paginator := .Paginate ($pages.GroupByPublishDate ($.Param "talksGroupByDate" | default "2006")) ($.Param "talksPaginate") }}
|
|
||||||
|
|
||||||
{{ range ($paginator).PageGroups }}
|
{{ if gt (len $pages) 0 }}
|
||||||
<span class="archive__key" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">{{ .Key }}</span>
|
{{ $paginator := .Paginate ($pages.GroupByPublishDate ($.Param "talksGroupByDate" | default "2006")) ($.Param "talksPaginate") }}
|
||||||
<ul class="archive__ul" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
|
{{ range ($paginator).PageGroups }}
|
||||||
{{ range .Pages }}
|
<span class="archive__key" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">{{ .Key }}</span>
|
||||||
<li class="archive__li" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
|
<ul class="archive__ul" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
|
||||||
<span class="talk__date" data-dir="{{ $.Param "languagedir" | default "ltr" }}" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">
|
{{ range .Pages }}
|
||||||
{{ .PublishDate.Format (i18n "talks-dateformat") }}
|
<li class="archive__li" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
|
||||||
</span>
|
<span class="talk__date" data-dir="{{ $.Param "languagedir" | default "ltr" }}" data-ani="{{ $.Site.Params.enableUiAnimation | default "true" }}">
|
||||||
{{ if .Params.disableLink }}
|
{{ .PublishDate.Format (i18n "talks-dateformat") }}
|
||||||
<div class="talk__title" data-title-wrap="{{ $titleWrap | default "wrap"}}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">{{ .Title }}</div>
|
</span>
|
||||||
{{ else }}
|
{{ if .Params.disableLink }}
|
||||||
<a href="{{ if .Params.externalLink }}{{ .Params.externalLink }}{{ else }}{{ .Permalink }}{{ end }}" target="{{ with .Params.externalLink }}_blank{{ end }}" rel="{{ with .Params.externalLink }}noreferrer{{ end }}" class="talk__title" data-title-wrap="{{ $titleWrap | default "wrap"}}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">{{ .Title }}</a>
|
<div class="talk__title" data-title-wrap="{{ $titleWrap | default "wrap"}}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">{{ .Title }}</div>
|
||||||
{{ end }}
|
{{ else }}
|
||||||
{{ with .Params.subLinks }}
|
<a href="{{ if .Params.externalLink }}{{ .Params.externalLink }}{{ else }}{{ .Permalink }}{{ end }}" target="{{ with .Params.externalLink }}_blank{{ end }}" rel="{{ with .Params.externalLink }}noreferrer{{ end }}" class="talk__title" data-title-wrap="{{ $titleWrap | default "wrap"}}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">{{ .Title }}</a>
|
||||||
<div class="talk__icons">
|
|
||||||
{{ range . }}
|
|
||||||
<a href="{{ .link }}" class="talk__icon" target="_blank" rel="noreferrer" title="{{ .type }}">
|
|
||||||
{{ partial (print "svgs/etc/" .type ".svg") (dict "width" 23 "height" 23) }}
|
|
||||||
</a>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
{{ with .Params.subLinks }}
|
||||||
{{ end }}
|
<div class="talk__icons">
|
||||||
</li>
|
{{ range . }}
|
||||||
|
<a href="{{ .link }}" class="talk__icon" target="_blank" rel="noreferrer" title="{{ .type }}">
|
||||||
|
{{ partial (print "svgs/etc/" .type ".svg") (dict "width" 23 "height" 23) }}
|
||||||
|
</a>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
{{ else }}
|
||||||
|
{{ i18n "no-contents" | default "There is nothing to display" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="grow"></div>
|
<div class="grow"></div>
|
||||||
{{ partial "pagination/pagination" . }}
|
{{ partial "pagination/pagination" . }}
|
||||||
|
|
Loading…
Reference in New Issue