Update Valine script

This commit is contained in:
Mimi 2020-11-26 09:57:39 +08:00
parent a4a1cdcf20
commit a412964ab2
2 changed files with 3 additions and 3 deletions

View File

@ -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) %}
<span id="{{ url_for(post.path) }}" class="post-meta-item leancloud_visitors" data-flag-title="{{ post.title }}" title="{{ __('post.views') }}">
<span class="post-meta-item-icon">
<i class="far fa-eye"></i>

View File

@ -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', '<div class="comments" id="valine-comments"></div>', {}, {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) %}