From 1d7daf74805b2c85c30ee5e54d1f2ab071b1a939 Mon Sep 17 00:00:00 2001 From: "Yanick.xia" Date: Sat, 1 Oct 2022 21:08:56 +0800 Subject: [PATCH] Add changyan count configuration (#570) --- _config.yml | 2 ++ scripts/filters/comment/changyan.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index a138cd2..301ab6c 100644 --- a/_config.yml +++ b/_config.yml @@ -610,6 +610,8 @@ changyan: enable: false appid: appkey: + # Show comments count + count: true # LiveRe comments system # You can get your uid from https://livere.com/insight/myCode (General web site) diff --git a/scripts/filters/comment/changyan.js b/scripts/filters/comment/changyan.js index b0ee8bf..e3bd25a 100644 --- a/scripts/filters/comment/changyan.js +++ b/scripts/filters/comment/changyan.js @@ -19,7 +19,7 @@ hexo.extend.filter.register('theme_inject', injects => { // Add post_meta hexo.extend.filter.register('theme_inject', injects => { const config = hexo.theme.config.changyan; - if (!config.enable || !config.appid || !config.appkey) return; + if (!config.enable || !config.count || !config.appid || !config.appkey) return; injects.postMeta.raw('changyan', ` {% if post.comments %}