Skip to content

Commit

Permalink
Fix serverURLs of Valine
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Sep 26, 2020
1 parent d51ca0e commit 9919fb5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -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
# ===============================================================
Expand Down Expand Up @@ -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
Expand All @@ -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]

Expand Down
5 changes: 1 addition & 4 deletions layout/_partials/footer.njk
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,7 @@

{%- if theme.footer.powered %}
<div class="powered-by">
{%- 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'})) }}
</div>
{%- endif %}
Expand Down
3 changes: 2 additions & 1 deletion layout/_third-party/comments/valine.njk
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion layout/_third-party/statistics/lean-analytics.njk
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9919fb5

Please sign in to comment.