{{- $config := .Site.Params.comments -}} {{- $enabledGlobally := $config.enable -}} {{- $disabledGlobally := ( not $enabledGlobally ) -}} {{ $optOut := ( eq .Params.comments false ) }} {{ $optIn := .Params.comments }} {{- $enableConditionOne := ( and $disabledGlobally $optIn ) -}} {{- $enableConditionTwo := ( and $enabledGlobally ( not $optOut ) ) -}} {{- if ( or $enableConditionOne $enableConditionTwo ) -}} {{- $disqusEnabled := .Site.DisqusShortname -}} {{- $issoEnabled := $config.isso.enable -}} {{- $staticmanEnabled := $config.staticman.enable -}} {{- $utterancesEnabled := $config.utterances.enable -}} {{- if and ( $disqusEnabled | or $issoEnabled | or $staticmanEnabled | or $utterancesEnabled ) ( not .Params.disable_comments) -}}
{{- if $disqusEnabled -}} {{ partial "comments/disqus" . }} {{- else if $issoEnabled -}} {{ partial "comments/isso" . }} {{- else if $staticmanEnabled -}} {{ partial "comments/staticman" . }} {{- else if $utterancesEnabled -}} {{ partial "comments/utterances" . }} {{- end -}}
{{- end -}} {{- end -}}