Skip to content

Commit

Permalink
Fix incorrect disqus_config
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Jan 15, 2020
1 parent 7240b02 commit 726ce63
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions layout/_third-party/comments/disqus.swig
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@
{%- endif %}
{%- if page.comments %}
<script>
var disqus_config = function() {
this.page.url = {{ page.permalink | json }};
this.page.identifier = {{ page.path | json }};
this.page.title = {{ page.title | json }};
{% if __('disqus') !== 'disqus' -%}
this.language = '{{ __('disqus') }}';
{% endif -%}
};
NexT.utils.loadComments(document.querySelector('#disqus_thread'), () => {
if (window.DISQUS) {
DISQUS.reset({
reload: true,
config: {
{%- if __('disqus') !== 'disqus' -%}
language: '{{ __('disqus') }}',
{% endif -%}
page: {
url: {{ page.permalink | json }},
identifier: {{ page.path | json }},
title: {{ page.title | json }}
}
}
config: disqus_config
});
} else {
var d = document, s = d.createElement('script');
Expand Down

0 comments on commit 726ce63

Please sign in to comment.