mirror of
https://github.com/Vimux/Binario.git
synced 2024-11-23 22:48:35 +00:00
Remove empty div.cards when no posts
This commit is contained in:
parent
94de1066d6
commit
f7d555ae80
1 changed files with 7 additions and 5 deletions
|
@ -5,15 +5,17 @@
|
||||||
{{ with .Content }}<div class="page__content page__content--notitle">{{ . }}</div>{{ end }}
|
{{ with .Content }}<div class="page__content page__content--notitle">{{ . }}</div>{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<div class="cards">
|
|
||||||
{{- $mainSections := .Site.Params.mainSections }}
|
{{- $mainSections := .Site.Params.mainSections }}
|
||||||
{{- $paginator := .Paginate (where .Data.Pages "Section" "in" $mainSections) }}
|
{{- $paginator := .Paginate (where .Data.Pages "Section" "in" $mainSections) }}
|
||||||
|
{{- if gt $paginator.TotalNumberOfElements 0 }}
|
||||||
|
<div class="cards">
|
||||||
{{- range $paginator.Pages }}
|
{{- range $paginator.Pages }}
|
||||||
<div class="card{{ if and (ge ($.Param "columns") 1) (le ($.Param "columns") 3) }} card--{{ $.Param "columns" }}col{{ else }} card--2col{{ end }}">
|
<div class="card{{ if and (ge ($.Param "columns") 1) (le ($.Param "columns") 3) }} card--{{ $.Param "columns" }}col{{ else }} card--2col{{ end }}">
|
||||||
{{ .Render "summary" }}
|
{{ .Render "summary" }}
|
||||||
</div>
|
</div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
|
{{- end }}
|
||||||
{{- if and (not .Site.Params.hideNoPostsWarning) (eq $paginator.TotalNumberOfElements 0) }}
|
{{- if and (not .Site.Params.hideNoPostsWarning) (eq $paginator.TotalNumberOfElements 0) }}
|
||||||
<div class="empty block center">
|
<div class="empty block center">
|
||||||
<div class="empty__icon">¯\_(ツ)_/¯</div>
|
<div class="empty__icon">¯\_(ツ)_/¯</div>
|
||||||
|
|
Loading…
Reference in a new issue