From 8039cd4b91d701ff423796dad3d4340552e36c44 Mon Sep 17 00:00:00 2001 From: liliang21 Date: Mon, 16 Aug 2021 16:44:33 +0800 Subject: [PATCH] add 'comment' to control single page's comment enable * `archetypes/default.md` add `comment` params * `layouts/partials/comment.html` add `.Params.comment` assert --- archetypes/default.md | 4 ++++ layouts/partials/comment.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/archetypes/default.md b/archetypes/default.md index be10dd461..ac2b9aa35 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -13,6 +13,10 @@ page: upd: "" authorComment: "" +# You can also close(false) or open(true) something for this content. +# P.S. comment can only be closed +comment: false + tags: [] categories: [] diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html index ba902cf33..ae8dd7ef0 100644 --- a/layouts/partials/comment.html +++ b/layouts/partials/comment.html @@ -3,7 +3,7 @@ {{- $comment := .Site.Params.Comment | default dict -}} {{- $commentConfig := dict -}} -{{- if $comment.enable -}} +{{- if and $comment.enable (ne .Params.comment false) -}}
{{- /* Disqus Comment System */ -}} {{- $disqus := $comment.disqus | default dict -}}