Add changyan count configuration (#570)

This commit is contained in:
Yanick.xia 2022-10-01 21:08:56 +08:00 committed by GitHub
parent c53fd12292
commit 1d7daf7480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -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 %}