diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html index aa099a0..42b720d 100644 --- a/layouts/partials/post_meta.html +++ b/layouts/partials/post_meta.html @@ -12,15 +12,17 @@ {{- if .Site.Params.staticman -}} | {{ $slug := replace .URL "/" "" }} - {{ $comments := index $.Site.Data.comments $slug }} - {{ if $comments }} - {{ if gt (len $comments) 1 }} - {{ len $comments }} {{ i18n "moreComment" }} + {{ if .Site.Data.comments }} + {{ $comments := index $.Site.Data.comments $slug }} + {{ if $comments }} + {{ if gt (len $comments) 1 }} + {{ len $comments }} {{ i18n "moreComment" }} + {{ else }} + {{ len $comments }} {{ i18n "oneComment" }} + {{ end }} {{ else }} - {{ len $comments }} {{ i18n "oneComment" }} + 0 {{ i18n "oneComment" }} {{ end }} - {{ else }} - 0 {{ i18n "oneComment" }} {{ end }} {{ end }} {{ if .IsTranslated -}} diff --git a/layouts/partials/staticman-comments.html b/layouts/partials/staticman-comments.html index ae609e2..07c541f 100644 --- a/layouts/partials/staticman-comments.html +++ b/layouts/partials/staticman-comments.html @@ -2,15 +2,17 @@ {{ $slug := replace .URL "/" "" }} - {{ $comments := index $.Site.Data.comments $slug }} - {{ if $comments }} - {{ if gt (len $comments) 1 }} -