mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-21 19:32:34 +00:00
New isso comments system
This commit is contained in:
parent
7e49895470
commit
7a4890f165
19
_config.yml
19
_config.yml
@ -520,11 +520,11 @@ fancybox: false
|
|||||||
|
|
||||||
# A JavaScript library for zooming images like Medium.
|
# A JavaScript library for zooming images like Medium.
|
||||||
# Warning: Do not enable both `fancybox` and `mediumzoom`.
|
# Warning: Do not enable both `fancybox` and `mediumzoom`.
|
||||||
# For more information: https://github.com/francoischalifour/medium-zoom
|
# For more information: https://medium-zoom.francoischalifour.com
|
||||||
mediumzoom: false
|
mediumzoom: false
|
||||||
|
|
||||||
# Vanilla JavaScript plugin for lazyloading images.
|
# Vanilla JavaScript plugin for lazyloading images.
|
||||||
# For more information: https://github.com/ApoorvSaxena/lozad.js
|
# For more information: https://apoorv.pro/lozad.js/demo/
|
||||||
lazyload: false
|
lazyload: false
|
||||||
|
|
||||||
# Pangu Support
|
# Pangu Support
|
||||||
@ -533,7 +533,7 @@ lazyload: false
|
|||||||
pangu: false
|
pangu: false
|
||||||
|
|
||||||
# Quicklink Support
|
# Quicklink Support
|
||||||
# For more information: https://github.com/GoogleChromeLabs/quicklink
|
# For more information: https://getquick.link
|
||||||
# Front-matter variable (unsupport home archive).
|
# Front-matter variable (unsupport home archive).
|
||||||
quicklink:
|
quicklink:
|
||||||
enable: false
|
enable: false
|
||||||
@ -580,15 +580,14 @@ comments:
|
|||||||
# order: -2
|
# order: -2
|
||||||
|
|
||||||
# Disqus
|
# Disqus
|
||||||
|
# For more information: https://disqus.com
|
||||||
disqus:
|
disqus:
|
||||||
enable: false
|
enable: false
|
||||||
shortname:
|
shortname:
|
||||||
count: true
|
count: true
|
||||||
|
|
||||||
# DisqusJS
|
# DisqusJS
|
||||||
# Alternative Disqus - Render comment component using Disqus API.
|
# For more information: https://disqusjs.skk.moe
|
||||||
# Demo: https://disqusjs.skk.moe
|
|
||||||
# For more information: https://github.com/SukkaW/DisqusJS
|
|
||||||
disqusjs:
|
disqusjs:
|
||||||
enable: false
|
enable: false
|
||||||
# API Endpoint of Disqus API (https://disqus.com/api/docs/).
|
# API Endpoint of Disqus API (https://disqus.com/api/docs/).
|
||||||
@ -600,6 +599,7 @@ disqusjs:
|
|||||||
shortname: # See: https://disqus.com/admin/settings/general/
|
shortname: # See: https://disqus.com/admin/settings/general/
|
||||||
|
|
||||||
# Changyan
|
# Changyan
|
||||||
|
# For more information: https://changyan.kuaizhan.com
|
||||||
changyan:
|
changyan:
|
||||||
enable: false
|
enable: false
|
||||||
appid:
|
appid:
|
||||||
@ -610,7 +610,7 @@ changyan:
|
|||||||
livere_uid: # <your_uid>
|
livere_uid: # <your_uid>
|
||||||
|
|
||||||
# Gitalk
|
# Gitalk
|
||||||
# For more information: https://gitalk.github.io, https://github.com/gitalk/gitalk
|
# For more information: https://gitalk.github.io
|
||||||
gitalk:
|
gitalk:
|
||||||
enable: false
|
enable: false
|
||||||
github_id: # GitHub repo owner
|
github_id: # GitHub repo owner
|
||||||
@ -634,6 +634,11 @@ utterances:
|
|||||||
# Available values: github-light | github-dark | preferred-color-scheme | github-dark-orange | icy-dark | dark-blue | photon-dark | boxy-light
|
# Available values: github-light | github-dark | preferred-color-scheme | github-dark-orange | icy-dark | dark-blue | photon-dark | boxy-light
|
||||||
theme: github-light
|
theme: github-light
|
||||||
|
|
||||||
|
# Isso
|
||||||
|
# For more information: https://posativ.org/isso/
|
||||||
|
isso: # <data_isso>
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
# Post Widgets & Content Sharing Services
|
# Post Widgets & Content Sharing Services
|
||||||
# See: https://theme-next.js.org/docs/third-party-services/post-widgets
|
# See: https://theme-next.js.org/docs/third-party-services/post-widgets
|
||||||
|
|||||||
10
layout/_third-party/comments/isso.njk
vendored
Normal file
10
layout/_third-party/comments/isso.njk
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{%- if page.comments %}
|
||||||
|
<script>
|
||||||
|
NexT.utils.loadComments('#isso-thread', () => {
|
||||||
|
const script = document.createElement('script');
|
||||||
|
script.src = '{{ theme.isso }}js/embed.min.js';
|
||||||
|
script.dataset.isso = '{{ theme.isso }}';
|
||||||
|
document.querySelector('#isso-thread').appendChild(script);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{%- endif %}
|
||||||
20
scripts/filters/comment/isso.js
Normal file
20
scripts/filters/comment/isso.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/* global hexo */
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
// Add comment
|
||||||
|
hexo.extend.filter.register('theme_inject', injects => {
|
||||||
|
const theme = hexo.theme.config;
|
||||||
|
if (!theme.isso) return;
|
||||||
|
|
||||||
|
injects.comment.raw('isso', `
|
||||||
|
<div class="comments">
|
||||||
|
<div id="isso-thread"></div>
|
||||||
|
</div>
|
||||||
|
`, {}, { cache: true });
|
||||||
|
|
||||||
|
injects.bodyEnd.file('isso', path.join(hexo.theme_dir, 'layout/_third-party/comments/isso.njk'));
|
||||||
|
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user