12345678910111213141516171819 |
- {{ $provider := trim (site.Params.comments.provider | lower) " " }}
- {{ if $provider }}
- {{ $provider_tpl := printf "partials/comments/%s.html" $provider }}
- {{ $provider_exists := templates.Exists $provider_tpl }}
- {{ if not $provider_exists }}
- {{ errorf "The '%s' comment provider was not found." $provider }}
- {{ end }}
- {{ $commentable_page_types := site.Params.comments.commentable | default dict }}
- {{ $commentable_page_type := index $commentable_page_types .Type | default false }}
- {{ $commentable_page := (ne .Params.commentable false) | and $commentable_page_type }}
- {{ if $commentable_page }}
- <section id="comments">
- {{ partial $provider_tpl . }}
- </section>
- {{ end }}
- {{ end }}
|