File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ showPagination = true
3333showhero = true
3434showTaxonomies = true
3535showRelatedContent = true
36+ showComments = true
3637relatedContentLimit = 5
3738heroStyle = " background"
3839
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ showDate: false
55showReadingTime : false
66showWordCount : false
77showTableOfContents : false
8- comments : false
8+ showComments : false
99---
1010
1111## 关于我
Original file line number Diff line number Diff line change @@ -27,13 +27,15 @@ showDate: false
2727showReadingTime : false
2828showWordCount : false
2929showTableOfContents : false
30- comments : false
30+ showComments : true
3131showhero : true
3232herostyle : background
3333---
3434
3535欢迎交换~
3636
37+ 在评论区留言也可
38+
3739这是我的信息:
3840
3941- T.本秋的自留地
Original file line number Diff line number Diff line change 5050 }
5151 } ) ;
5252 }
53+
54+ // ========== 新增:强制 Twikoo 重新渲染评论区 ==========
55+ if ( typeof twikoo !== 'undefined' ) {
56+ // console.log('Twikoo 已存在,强制重新渲染评论区');
57+ // 重新调用 init 方法,让 Twikoo 重新拉取当前页面的评论
58+ twikoo . init ( {
59+ envId : 'https://twikoo.texsd.eu.org' , // 换成你的实际地址
60+ el : '#tcomment' ,
61+ path : window . location . pathname ,
62+ lang : 'zh-CN' ,
63+ } ) ;
64+ } else {
65+ // 如果 Twikoo 还没加载,就动态加载
66+ const script = document . createElement ( 'script' ) ;
67+ script . src = 'https://cdn.jsdelivr.net/npm/twikoo@1.6.41/dist/twikoo.all.min.js' ;
68+ script . onload = ( ) => {
69+ twikoo . init ( {
70+ envId : 'https://twikoo.texsd.eu.org' ,
71+ el : '#tcomment' ,
72+ path : window . location . pathname ,
73+ lang : 'zh-CN' ,
74+ } ) ;
75+ } ;
76+ document . head . appendChild ( script ) ;
77+ }
78+ // ====================================================
79+
5380 } , 50 ) ;
54- document . dispatchEvent ( new Event ( 'DOMContentLoaded' ) ) ;
5581 } ) ;
56- </ script >
82+ </ script >
Original file line number Diff line number Diff line change 1+ {{- /* 评论区 - Twikoo */ -}}
2+ < div id ="tcomment "> </ div >
3+ < script src ="https://cdn.jsdelivr.net/npm/twikoo@latest/dist/twikoo.all.min.js "> </ script >
4+ < script >
5+ twikoo . init ( {
6+ envId : 'https://twikoo.texsd.eu.org' ,
7+ el : '#tcomment' ,
8+ lang : 'zh-CN' ,
9+ } )
10+ </ script >
You can’t perform that action at this time.
0 commit comments