{{ if .Site.Data.blog.staticmanComments.enable }}

{{ i18n "comments" }}

{{ $postSlug := .File.BaseFileName }} {{ $.Scratch.Add "entryId" $postSlug }} {{ $.Scratch.Set "hasComments" 0 }} {{ if .Site.Data.comments }} {{ $comments := index $.Site.Data.comments ($.Scratch.Get "entryId") }} {{ range $comments }} {{ $.Scratch.Add "hasComments" 1 }} {{ if not .reply_to }} {{ $.Scratch.Set "parentId" ._id }} {{ $.Scratch.Set "parentName" .name }} {{ $.Scratch.Set "hasReplies" 0 }}

{{ .name }}

{{ .message | markdownify }}
{{ range $comments }} {{ if eq .reply_to ( $.Scratch.Get "parentId" ) }} {{ $.Scratch.Add "hasReplies" 1 }}

{{ .name }}
{{ ( $.Scratch.Get "parentName" ) }}

{{ .message | markdownify }} {{ if gt ($.Scratch.Get "hasReplies") 0 }} {{ end }}
{{ end }} {{ end }} {{ end }} {{ end }} {{ end }} {{ if eq ($.Scratch.Get "hasComments") 0 }}

{{ i18n "noComments" }}

{{ end }}

{{ i18n "tellSomething" }}

{{ if .Site.Data.blog.staticmanComments.notifications }} {{ i18n "emailUseGravatarNotifications" | markdownify }} {{else}} {{ i18n "emailUseGravatar" | markdownify }} {{end}}
{{ if .Site.Data.blog.staticmanComments.notifications }}
{{ end }}
{{ end }}