diff --git a/README.md b/README.md index 30733f2..929e78a 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ googleAnalytics = "" # Enable Google Analytics by entering your tracking id 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 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] email = "example@example.com" diff --git a/layouts/index.html b/layouts/index.html index a62fe36..20bdb1a 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,14 +2,14 @@
{{ $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 }}
{{ .Render "summary" }}
{{ end }}
- {{- if eq $paginator.TotalNumberOfElements 0 }} + {{- if and (not .Site.Params.hideNoPostsWarning) (eq $paginator.TotalNumberOfElements 0) }}
¯\_(ツ)_/¯

{{ T "empty_title" }}