File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11node_modules /
2- * .log
2+ * .log
3+ package-lock.json
Original file line number Diff line number Diff line change 1+ {{ next_data (' giscus' , theme .giscus ) }}
2+
3+ <script >
4+ document .addEventListener (' page:loaded' , () => {
5+ if (! CONFIG .page .comments ) return ;
6+
7+ NexT .utils .loadComments (' .giscus-container' )
8+ .then (() => NexT .utils .getScript (' https://giscus.app/client.js' , {
9+ attributes: {
10+ async : true ,
11+ crossOrigin : ' anonymous' ,
12+ ' data-repo' : CONFIG .giscus .repo ,
13+ ' data-repo-id' : CONFIG .giscus .repo_id ,
14+ ' data-category' : CONFIG .giscus .category ,
15+ ' data-category-id' : CONFIG .giscus .category_id ,
16+ ' data-mapping' : CONFIG .giscus .mapping ,
17+ ' data-reactions-enabled' : CONFIG .giscus .reactions_enabled ,
18+ ' data-emit-metadata' : CONFIG .giscus .emit_metadata ,
19+ ' data-theme' : CONFIG .giscus .theme ,
20+ ' data-lang' : CONFIG .giscus .lang ,
21+ ' data-input-position' : CONFIG .giscus .input_position ,
22+ ' data-loading' : CONFIG .giscus .loading
23+ },
24+ parentNode: document .querySelector (' .giscus-container' )
25+ }));
26+ });
27+ </script >
Original file line number Diff line number Diff line change @@ -17,26 +17,13 @@ hexo.extend.filter.register('theme_inject', injects => {
1717
1818 injects . comment . raw ( 'giscus' , `
1919 {% if page.comments %}
20- <div class="comments">
21- <script src="https://giscus.app/client.js"
22- data-repo="${ config . repo } "
23- data-repo-id="${ config . repo_id } "
24- data-category="${ config . category } "
25- data-category-id="${ config . category_id } "
26- data-mapping="${ config . mapping } "
27- data-reactions-enabled="${ config . reactions_enabled } "
28- data-emit-metadata="${ config . emit_metadata } "
29- data-theme="${ config . theme } "
30- data-lang="${ config . lang } "
31- crossorigin="${ config . crossorigin } "
32- data-input-position="${ config . input_position } "
33- data-loading="${ config . loading } "
34- async>
35- </script>
20+ <div class="comments giscus-container">
3621 </div>
3722 {% endif %}
3823 ` ) ;
3924
25+ injects . bodyEnd . raw ( 'giscus' , utils . getFileContent ( 'giscus.njk' ) ) ;
26+
4027 injects . style . push ( utils . getFilePath ( 'giscus.styl' ) ) ;
4128
42- } , ( hexo . config . giscus || { } ) . priority ) ;
29+ } , ( hexo . config . giscus || { } ) . priority ) ;
You can’t perform that action at this time.
0 commit comments