Add hideNoPostsWarning param

This commit is contained in:
vimux 2019-01-14 09:26:42 -05:00
parent ecfa7f6421
commit 30e3277682
No known key found for this signature in database
GPG key ID: 5A34FDC4EE832E34
2 changed files with 3 additions and 2 deletions

View file

@ -115,6 +115,7 @@ googleAnalytics = "" # Enable Google Analytics by entering your tracking id
mathjax = true # Enable MathJax for all site pages mathjax = true # Enable MathJax for all site pages
mathjaxPath = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" # Specify MathJax path. Optional mathjaxPath = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" # Specify MathJax path. Optional
mathjaxConfig = "TeX-AMS-MML_HTMLorMML" # Specify MathJax config. Optional mathjaxConfig = "TeX-AMS-MML_HTMLorMML" # Specify MathJax config. Optional
hideNoPostsWarning = false # Don't show no posts empty state warning in main page, if true
[Params.Social] [Params.Social]
email = "example@example.com" email = "example@example.com"

View file

@ -2,14 +2,14 @@
<main class="main"> <main class="main">
<div class="cards"> <div class="cards">
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }} {{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
{{ $paginator := .Paginate ( where .Data.Pages "Section" "in" $mainSections ) }} {{ $paginator := .Paginate (where .Data.Pages "Section" "in" $mainSections) }}
{{ 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>
{{- if 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>
<h3 class="empty__title">{{ T "empty_title" }}</h3> <h3 class="empty__title">{{ T "empty_title" }}</h3>