Files
hugo_blog.awin.one/layouts/partials/comment.html
2022-05-10 01:13:38 +08:00

22 lines
795 B
HTML

{{/* Deprecation warning(v1.0.0) starts */}}
{{- if .Site.Params.comment.platform }}
{{- warnf "Param `comment.platform` in params.yaml is deprecated and will be removed in Eureka v1.0.0. Please use `comment.handler` instead." }}
{{- end }}
{{- $commentHandler := .Site.Params.comment.handler | default .Site.Params.comment.platform }}
{{/* Deprecation warning(v1.0.0) ends */}}
{{- $enableComment := false }}
{{- if $commentHandler }}
{{- $bundles := partial "utils/get-bundles" . }}
{{- $enableComment = true }}
{{- range $bundles.Reverse }}
{{- if and (ne .Params.enableComment nil) (ne .Params.enableComment "") }}
{{- $enableComment = .Params.enableComment }}
{{- end }}
{{- end }}
{{- end }}
{{ if $enableComment }}
{{ partial (printf "comment/%s" $commentHandler) . }}
{{ end }}