diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index a9d5391..36460f4 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,13 +1,27 @@ {{- /* You can add your own layouts/comments.html to override this file */ -}} -{{- with site.Params.commentSystem.remark42 -}} - {{- partial "remark42.html" . }} -{{- end -}} +{{- $pageCommentSystems := .Param "pageCommentSystems"}} +{{- if not $pageCommentSystems }} + {{- $pageCommentSystems = site.Params.defaultCommentSystems }} +{{- end }} -{{- with site.Params.commentSystem.telegramWidget -}} - {{- partial "telegram_widget.html" . }} -{{- end -}} +{{- $page := . -}} +{{- with site.Params.commentSystems -}} + {{- if $pageCommentSystems.remark42 -}} + {{- with .remark42 -}} + {{- partial "remark42.html" . }} + {{- end -}} + {{- end -}} -{{- with site.Params.commentSystem.disqus -}} - {{- partial "disqus.html" . }} + {{- if $pageCommentSystems.telegramWidget -}} + {{- with .telegramWidget -}} + {{- partial "telegram_widget.html" . }} + {{- end -}} + {{- end -}} + + {{- if $pageCommentSystems.disqus -}} + {{- with .disqus -}} + {{- partial "disqus.html" (dict "page" $page "disqus" .) }} + {{- end -}} + {{- end -}} {{- end -}} diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html index dc86fc2..e6b9b33 100644 --- a/layouts/partials/disqus.html +++ b/layouts/partials/disqus.html @@ -1,3 +1,30 @@