mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +00:00
22 lines
854 B
Plaintext
22 lines
854 B
Plaintext
{%- 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 | safedump }},
|
|
identifier: {{ page.path | safedump }},
|
|
title : {{ page.title | safedump }},
|
|
});
|
|
}, window.DisqusJS);
|
|
});
|
|
</script>
|
|
{%- endif %}
|