From 30e3277682acf5ad2ab080fd6b06b8b12eaa44f6 Mon Sep 17 00:00:00 2001 From: vimux Date: Mon, 14 Jan 2019 09:26:42 -0500 Subject: [PATCH] Add hideNoPostsWarning param --- README.md | 1 + layouts/index.html | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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" }}