2025-2-26-fixed
This commit is contained in:
21
themes/next/layout/_third-party/comments/disqusjs.swig
vendored
Normal file
21
themes/next/layout/_third-party/comments/disqusjs.swig
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{%- if page.comments %}
|
||||
{%- set disqusjs_css_uri = theme.vendors.disqusjs_css or '//cdn.jsdelivr.net/npm/disqusjs@1/dist/disqusjs.css' %}
|
||||
<link rel="stylesheet" href="{{ disqusjs_css_uri }}">
|
||||
|
||||
{%- set disqusjs_js_uri = theme.vendors.disqusjs_js or '//cdn.jsdelivr.net/npm/disqusjs@1/dist/disqus.js' %}
|
||||
|
||||
<script>
|
||||
NexT.utils.loadComments(document.querySelector('#disqus_thread'), () => {
|
||||
NexT.utils.getScript('{{ disqusjs_js_uri }}', () => {
|
||||
window.dsqjs = new DisqusJS({
|
||||
api : '{{ theme.disqusjs.api }}' || 'https://disqus.com/api/',
|
||||
apikey : '{{ theme.disqusjs.apikey }}',
|
||||
shortname : '{{ theme.disqusjs.shortname }}',
|
||||
url : {{ page.permalink | json }},
|
||||
identifier: {{ page.path | json }},
|
||||
title : {{ page.title | json }},
|
||||
});
|
||||
}, window.DisqusJS);
|
||||
});
|
||||
</script>
|
||||
{%- endif %}
|
||||
Reference in New Issue
Block a user