From 9919fb5c4956315e51d7eeaec32a416f76b06edb Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Sun, 27 Sep 2020 01:35:40 +0800 Subject: [PATCH] Fix serverURLs of Valine --- _config.yml | 4 ++-- layout/_partials/footer.njk | 5 +---- layout/_third-party/comments/valine.njk | 3 ++- layout/_third-party/statistics/lean-analytics.njk | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/_config.yml b/_config.yml index 787c987..02758d9 100644 --- a/_config.yml +++ b/_config.yml @@ -1,5 +1,5 @@ # =============================================================== -# It's recommended to use Alternate Theme Config to configure the theme +# It's recommended to use Alternate Theme Config to configure NexT # Modifying this file may result in merge conflict # See: https://theme-next.js.org/docs/getting-started/configuration # =============================================================== @@ -608,6 +608,7 @@ valine: enable: false appId: # Your leancloud application appid appKey: # Your leancloud application appkey + serverURLs: # When the custom domain name is enabled, fill it in here placeholder: Just go go # Comment box placeholder avatar: mm # Gravatar style meta: [nick, mail, link] # Custom comment header @@ -616,7 +617,6 @@ valine: visitor: false # Article reading statistic comment_count: true # If false, comment count will only be displayed in post page, not in home page recordIP: false # Whether to record the commenter IP - serverURLs: # When the custom domain name is enabled, fill it in here (it will be detected automatically by default, no need to fill in) enableQQ: false # Whether to enable the Nickname box to automatically get QQ Nickname and QQ Avatar requiredFields: [] # Set required fields: [nick] | [nick, mail] diff --git a/layout/_partials/footer.njk b/layout/_partials/footer.njk index 2592290..5265069 100644 --- a/layout/_partials/footer.njk +++ b/layout/_partials/footer.njk @@ -76,10 +76,7 @@ {%- if theme.footer.powered %}
- {%- set next_site = 'https://theme-next.js.org' %} - {%- if theme.scheme !== 'Gemini' %} - {%- set next_site = 'https://theme-next.js.org/' + theme.scheme | lower + '/' %} - {%- endif %} + {%- set next_site = 'https://theme-next.js.org' if theme.scheme === 'Gemini' else 'https://theme-next.js.org/' + theme.scheme | lower + '/' %} {{- __('footer.powered', next_url('https://hexo.io', 'Hexo', {class: 'theme-link'}) + ' & ' + next_url(next_site, 'NexT.' + theme.scheme, {class: 'theme-link'})) }}
{%- endif %} diff --git a/layout/_third-party/comments/valine.njk b/layout/_third-party/comments/valine.njk index c3b44bc..5474a7c 100644 --- a/layout/_third-party/comments/valine.njk +++ b/layout/_third-party/comments/valine.njk @@ -2,8 +2,9 @@ NexT.utils.loadComments('#valine-comments', () => { NexT.utils.getScript('{{ theme.vendors.valine }}', () => { new Valine(Object.assign({ - el : '#valine-comments', + el: '#valine-comments', path: {{ url_for(page.path) | replace(r/index\.html$/, '') | safedump }}, + serverURLs: 'https://{{ theme.valine.appId.slice(0, 8) | lower }}.api.lncldglobal.com' }, {{ theme.valine | safedump }} )); }, window.Valine); diff --git a/layout/_third-party/statistics/lean-analytics.njk b/layout/_third-party/statistics/lean-analytics.njk index 647e90f..4ab00b9 100644 --- a/layout/_third-party/statistics/lean-analytics.njk +++ b/layout/_third-party/statistics/lean-analytics.njk @@ -82,7 +82,7 @@ } } - const api_server = app_id.slice(-9) !== '-MdYXbMMI' ? server_url : `https://${app_id.slice(0, 8).toLowerCase()}.api.lncldglobal.com`; + const api_server = app_id.slice(-9) === '-MdYXbMMI' ? `https://${app_id.slice(0, 8).toLowerCase()}.api.lncldglobal.com` : server_url; if (api_server) { fetchData(api_server);