diff --git a/README.md b/README.md index 74f5a19..816173d 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,7 @@ layout: sidebar_width: 8rem # Comment:1、Valine (recommended);2、Gitalk +# You can close the comment section on one of your posts by marking `comments: false` in front-matter. # 1、Valine [A fast, simple & powerful comment system](https://github.com/xCss/Valine) # You need create leancloud account first (https://console.leancloud.app), then put the id|key in below. @@ -426,4 +427,4 @@ The basic idea is, whenever using a project using SATA license, people shall sta ## Stargazers over time -[![Stargazers over time](https://starchart.cc/Shen-Yu/hexo-theme-ayer.svg)](https://starchart.cc/Shen-Yu/hexo-theme-ayer) \ No newline at end of file +[![Stargazers over time](https://starchart.cc/Shen-Yu/hexo-theme-ayer.svg)](https://starchart.cc/Shen-Yu/hexo-theme-ayer) diff --git a/layout/_partial/post/gitalk.ejs b/layout/_partial/post/gitalk.ejs index d2289dd..873cb13 100644 --- a/layout/_partial/post/gitalk.ejs +++ b/layout/_partial/post/gitalk.ejs @@ -1,4 +1,4 @@ -<% if (theme.gitalk.enable) { %> +<% if (theme.gitalk.enable && post.comments) { %>
<%- css('https://cdn.jsdelivr.net/npm/gitalk@1.6.2/dist/gitalk.css') %> <%- js('https://cdn.jsdelivr.net/npm/gitalk@1.6.2/dist/gitalk.min.js') %> @@ -18,4 +18,4 @@ gitalk.render('gitalk-container') -<% } %> \ No newline at end of file +<% } %> diff --git a/layout/_partial/post/minivaline.ejs b/layout/_partial/post/minivaline.ejs index 91aa117..227a3a2 100644 --- a/layout/_partial/post/minivaline.ejs +++ b/layout/_partial/post/minivaline.ejs @@ -1,4 +1,4 @@ -<% if (!index && theme.leancloud && theme.leancloud.enable){ %> +<% if (!index && theme.leancloud && theme.leancloud.enable && post.comments){ %>
diff --git a/layout/_partial/post/valine.ejs b/layout/_partial/post/valine.ejs index 39c9a97..3ef4038 100644 --- a/layout/_partial/post/valine.ejs +++ b/layout/_partial/post/valine.ejs @@ -1,4 +1,4 @@ -<% if (!index && theme.leancloud && theme.leancloud.enable){ %> +<% if (!index && theme.leancloud && theme.leancloud.enable && post.comments){ %>