From a412964ab29f7cb60e421cc17fab01ace01195f6 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Thu, 26 Nov 2020 09:57:39 +0800 Subject: [PATCH] Update Valine script --- layout/_partials/post/post-meta.njk | 2 +- scripts/filters/comment/valine.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layout/_partials/post/post-meta.njk b/layout/_partials/post/post-meta.njk index 73f8401..a020fad 100644 --- a/layout/_partials/post/post-meta.njk +++ b/layout/_partials/post/post-meta.njk @@ -51,7 +51,7 @@ {%- endif %} {# LeanCloud PageView #} - {%- if theme.leancloud_visitors.enable or (theme.valine.enable and theme.valine.visitor) %} + {%- if theme.leancloud_visitors.enable or (theme.valine and theme.valine.enable and theme.valine.visitor) %} diff --git a/scripts/filters/comment/valine.js b/scripts/filters/comment/valine.js index 774c6f7..c3363b9 100644 --- a/scripts/filters/comment/valine.js +++ b/scripts/filters/comment/valine.js @@ -8,7 +8,7 @@ const { iconText } = require('./common'); // Add comment hexo.extend.filter.register('theme_inject', injects => { const theme = hexo.theme.config; - if (!theme.valine.enable || !theme.valine.appId || !theme.valine.appKey) return; + if (!theme.valine || !theme.valine.enable || !theme.valine.appId || !theme.valine.appKey) return; injects.comment.raw('valine', '
', {}, {cache: true}); @@ -19,7 +19,7 @@ hexo.extend.filter.register('theme_inject', injects => { // Add post_meta hexo.extend.filter.register('theme_inject', injects => { const theme = hexo.theme.config; - if (!theme.valine.enable || !theme.valine.appId || !theme.valine.appKey) return; + if (!theme.valine || !theme.valine.enable || !theme.valine.appId || !theme.valine.appKey) return; injects.postMeta.raw('valine', ` {% if post.comments and (is_post() or theme.valine.comment_count) %}