jekyll-theme-h2o-ac 1.3.6 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/_config.yml +47 -1
  3. data/_includes/layouts/footer.html +27 -5
  4. data/_includes/layouts/head.html +3 -2
  5. data/_includes/layouts/header.html +1 -1
  6. data/_includes/layouts/metainfo.html +3 -3
  7. data/_includes/plugins/analytics/ackee.html +3 -0
  8. data/_includes/plugins/analytics/analytics.html +5 -0
  9. data/_includes/plugins/analytics/fathom.html +3 -0
  10. data/_includes/plugins/analytics/matomo.html +14 -0
  11. data/_includes/plugins/analytics/plausible.html +4 -0
  12. data/_includes/plugins/analytics/shynet.html +6 -0
  13. data/_includes/plugins/comments/artalk_css.html +3 -0
  14. data/_includes/plugins/comments/artalk_js.html +16 -0
  15. data/_includes/plugins/comments/comments_block.html +168 -27
  16. data/_includes/plugins/comments/comments_js.html +10 -9
  17. data/_includes/plugins/comments/disqus.html +1 -1
  18. data/_includes/plugins/comments/giscus_js.html +54 -0
  19. data/_includes/plugins/comments/twikoo_js.html +13 -0
  20. data/_includes/plugins/comments/utterances_js.html +10 -0
  21. data/_includes/plugins/comments/waline_js.html +1 -1
  22. data/_includes/plugins/markdown/fancybox_css.html +1 -1
  23. data/_includes/plugins/markdown/fancybox_js.html +1 -1
  24. data/_includes/plugins/markdown/mathjax.html +1 -2
  25. data/_includes/plugins/markdown/mermaid_js.html +1 -1
  26. data/_includes/plugins/markdown/prism_css.html +4 -4
  27. data/_includes/plugins/markdown/prism_js.html +3 -3
  28. data/_layouts/default.html +1 -1
  29. data/assets/css/app.min.css +1 -1
  30. data/assets/css/app.min.css.map +1 -1
  31. data/assets/icons/cloudflare-logo.webp +0 -0
  32. data/assets/icons/netlify-icon-light.svg +22 -0
  33. data/assets/icons/vercel-logotype-dark.png +0 -0
  34. data/assets/js/app.min.js +1 -1
  35. data/assets/js/app.min.js.map +1 -1
  36. metadata +15 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 719aba950fd3580dbbe73c6a48d8f05ad5ee2c348bc1a30cb7450694ef5a0453
4
- data.tar.gz: 057c4715b217b97a9e60c88ab3053ce83b8f1709a73bb0255494d527ebb6d665
3
+ metadata.gz: ec60aee793daf441774cae331b78ba0251b5d2da24e59fa4ec880c4491f5af9b
4
+ data.tar.gz: faf930f91e02759ce8f58da7cb8f1ac41629b71fc0a927e4954f903567e31a5e
5
5
  SHA512:
6
- metadata.gz: 253ff297ca2947ac735941c98df92a90f832086182880f7675b9fe39fc88d84462851409ce2cab243c56a239f75e8720e48c45636b7da01097107f207d6eba79
7
- data.tar.gz: f240b6b2e2cd218652cbed81cd5616492c40ff150cdf15e4bda217959eac09ad44f289f94a47c5c50d19826e6f31bd0bd6ba637f92d2343d59ddb7c43ce157e3
6
+ metadata.gz: aa3e9fb4f52f138137b61e84be439b64c18e27626187394248d4255323d26de60bd0ec3e9751af7e0d936ff9f4bfc4ce396fb05965f35d0fe0fffe2f0b76922e
7
+ data.tar.gz: 0d8f8aa581aa647fb2f01085786f79dcc74b48d13feae3faaf3714c4439585c59596c61d79d29a4ede6b72874793326e6cbf2bad952666d017159b4c202016f8
data/_config.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  # jekyll-theme-h2o-ac
2
- version: 1.3.6
2
+ version: 1.5.0
3
3
 
4
4
  # Site settings 配置站点
5
5
  title: 'Mr Li'
@@ -76,6 +76,23 @@ comments:
76
76
  waline_url: 'https://h2o-ac-waline.lisz.top/'
77
77
  waline_reaction: false
78
78
  waline_locale:
79
+ artalk: false
80
+ artalk_url: 'https://artalk.lisz.top'
81
+ artalk_name: 'h2o-ac'
82
+ artalk_uaBadge: false
83
+ utterances: false
84
+ utterances_url: 'https://utteranc.es/client.js'
85
+ # utterances_repo: 'zhonger/utterances-comments'
86
+ giscus: false
87
+ giscus_url: 'https://giscus.app/client.js'
88
+ # giscus_repo: 'zhonger/giscus-comments'
89
+ # giscus_repo_id: 'R_kgDONLt80A'
90
+ # giscus_category_id: 'DIC_kwDONLt80M4CkDnG'
91
+ giscus_lang: 'zh-CN'
92
+ twikoo: false
93
+ twikoo_url: 'https://twikoo.lisz.top'
94
+ # twikoo_region: 'ap-shanghai'
95
+ # twikoo_lang: 'zh-CN'
79
96
 
80
97
  # MathJax 公式支持 by Ray-Eldath
81
98
  mathjax: true
@@ -114,6 +131,9 @@ supports:
114
131
 
115
132
  # Badges
116
133
  badges:
134
+ netlify: true # Netlify
135
+ vercel: true # Vercel
136
+ cloudflare: true # Cloudflare
117
137
  foreverblog: true # Foreverblog
118
138
  wormhole: true # Wormhole
119
139
  travelling: true # Travelling
@@ -125,6 +145,7 @@ alivestart: "12/23/2021"
125
145
 
126
146
  # Beian 备案号
127
147
  beian: '沪ICP备xxxxxxxx号'
148
+ # moe_beian: 'xxxxxxxx'
128
149
 
129
150
  # CC License
130
151
  cclicense: true
@@ -143,6 +164,31 @@ umami:
143
164
  id:
144
165
  js:
145
166
 
167
+ # Shynet Analytics
168
+ shynet: false
169
+ shynet_url: ''
170
+
171
+ # Plausible Analytics
172
+ plausible: false
173
+ plausible_domain: 'example.com'
174
+ plausible_url: ''
175
+ # plausible_js: ''
176
+
177
+ # Fathom Analytics
178
+ fathom: false
179
+ fathom_id: ''
180
+
181
+ # Ackee Analytics
182
+ ackee: false
183
+ ackee_url: ''
184
+ ackee_id: ''
185
+ # ackee_js: ''
186
+
187
+ # Matomo Analytics
188
+ matomo: false
189
+ matomo_url: ''
190
+ matomo_id: ''
191
+
146
192
  # Google Analytics
147
193
  # google_analytics: UA-XXXXXXXXX-X
148
194
  google_analytics:
@@ -21,6 +21,9 @@
21
21
  {% if site.beian and site.beian != "" %}
22
22
  <a href="https://beian.miit.gov.cn/" target="_blank" class="extlinks">{{ site.beian }}</a>
23
23
  {% endif %}
24
+ {% if site.moe_beian and site.moe_beian != "" %}
25
+ <a href="https://icp.gov.moe/?keyword={{ site.moe_beian }}" target="_blank" class="extlinks">萌ICP备{{ site.moe_beian }}号</a>
26
+ {% endif %}
24
27
  <a href="/rss.xml" target="_blank" aria-label="Terms of Service" class="others">
25
28
  <svg class="icon" aria-hidden="true">
26
29
  <use xlink:href="#icon-rss"></use>
@@ -72,30 +75,49 @@
72
75
  {% if site.supports.upyun %}
73
76
  <section>
74
77
  <a href="https://www.upyun.com/?utm_source=lianmeng&utm_medium=referral" target="_blank" class="extlinks">{{
75
- footer.upyun }} <img src="{{ " /assets/icons/upyun.png" | prepend: site.baseurl }}" class="upyun" alt="upyun" /></a>
78
+ footer.upyun }} <img src="{{ "/assets/icons/upyun.png" | prepend: site.baseurl }}" class="upyun" alt="upyun" /></a>
79
+ </section>
80
+ {% endif %}
81
+ {% if site.badges.netlify or site.badges.vercel or site.badges.cloudflare %}
82
+ <section class="badges">
83
+ {% if site.badges.netlify %}
84
+ <a href="https://netlify.com" target="_blank" class="netlify" aria-label="netlify">
85
+ <img src="{{ "/assets/icons/netlify-icon-light.svg" | prepend: site.baseurl }}" alt="netlify">
86
+ </a>
87
+ {% endif %}
88
+ {% if site.badges.vercel %}
89
+ <a href="https://vercel.com" target="_blank" class="vercel" aria-label="vercel">
90
+ <img src="{{ "/assets/icons/vercel-logotype-dark.png" | prepend: site.baseurl }}" alt="vercel">
91
+ </a>
92
+ {% endif %}
93
+ {% if site.badges.cloudflare %}
94
+ <a href="https://www.cloudflare.com" target="_blank" class="cloudflare" aria-label="cloudflare">
95
+ <img src="{{ "/assets/icons/cloudflare-logo.webp" | prepend: site.baseurl }}" alt="cloudflare">
96
+ </a>
97
+ {% endif %}
76
98
  </section>
77
99
  {% endif %}
78
100
  {% if site.badges.foreverblog or site.badges.wormhole or site.badges.travelling or site.badges.notbyAI %}
79
101
  <section class="badges">
80
102
  {% if site.badges.foreverblog %}
81
103
  <a href="https://www.foreverblog.cn/" target="_blank" class="foreverblog" aria-label="foreverblog">
82
- <img src="{{ " /assets/icons/forever_en_default.png" | prepend: site.baseurl }}" alt="foreverblog">
104
+ <img src="{{ "/assets/icons/forever_en_default.png" | prepend: site.baseurl }}" alt="foreverblog">
83
105
  </a>
84
106
  {% endif %}
85
107
  {% if site.badges.wormhole %}
86
108
  <a href="https://www.foreverblog.cn/go.html" target="_blank" class="wormhole" aria-label="wormhole">
87
- <img src="{{ " /assets/icons/wormhole_3.gif" | prepend: site.baseurl }}" alt="" title="穿梭虫洞-随机访问十年之约友链博客">
109
+ <img src="{{ "/assets/icons/wormhole_3.gif" | prepend: site.baseurl }}" alt="" title="穿梭虫洞-随机访问十年之约友链博客">
88
110
  </a>
89
111
  {% endif%}
90
112
  {% if site.badges.travelling %}
91
113
  <a href="https://www.travellings.cn/go.html" target="_blank" class="travelling-badge" aria-label="Travelling"
92
114
  rel="noopener" title="开往-友链接力">
93
- <img src="{{ " /assets/icons/travellings.gif" | prepend: site.baseurl }}" alt="开往-友链接力">
115
+ <img src="{{ "/assets/icons/travellings.gif" | prepend: site.baseurl }}" alt="开往-友链接力">
94
116
  </a>
95
117
  {% endif %}
96
118
  {% if site.badges.notbyAI %}
97
119
  <a href="https://notbyai.fyi/" target="_blank" class="notbyAI" aria-label="notbyAI">
98
- <img src="{{ " /assets/icons/notbyAI-white.png" | prepend: site.baseurl }}" alt="Written by Human, Not by AI">
120
+ <img src="{{ "/assets/icons/notbyAI-white.png" | prepend: site.baseurl }}" alt="Written by Human, Not by AI">
99
121
  </a>
100
122
  {% endif %}
101
123
  </section>
@@ -54,8 +54,8 @@
54
54
  <link rel="icon" href="{{ site.favicon | prepend: site.baseurl }}" type="image/x-icon" />
55
55
  <link rel="bookmark" href="{{ site.favicon | prepend: site.baseurl }}" type="image/x-icon" />
56
56
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/normalize.min.css" async>
57
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css" />
58
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@5.2.0/github-markdown-light.min.css">
57
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont/style.css" />
58
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css/github-markdown-light.min.css">
59
59
  {% if layout.type == "post" %}
60
60
  {% include plugins/others/social_css.html%}
61
61
  {% include plugins/markdown/fancybox_css.html %}
@@ -64,6 +64,7 @@
64
64
  {% endif %}
65
65
  {% include plugins/markdown/prism_css.html %}
66
66
  {% include plugins/comments/waline_css.html %}
67
+ {% include plugins/comments/artalk_css.html %}
67
68
  {% include plugins/search/docsearch_css.html %}
68
69
  <link rel="stylesheet" href="{{ "/assets/css/app.min.css" | prepend: site.baseurl }}">
69
70
  <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
@@ -31,7 +31,7 @@
31
31
  {% for i in site.nav %}
32
32
  {% if i[1].first %}
33
33
  <li class="dropdown">
34
- <a class="dropdown-toggle" href="#"> {{ i[0] }} </a>
34
+ <a class="dropdown-toggle" href="javascript:void(0);"> {{ i[0] }} </a>
35
35
  <ul class="dropdown-menu">
36
36
  {% for j in i[1] %}
37
37
  <li>
@@ -1,6 +1,6 @@
1
- <script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.2/dayjs.min.js"></script>
2
- <script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.2/plugin/customParseFormat.js"></script>
3
- <script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.2/plugin/relativeTime.js"></script>
1
+ <script src="https://cdn.jsdelivr.net/npm/dayjs/dayjs.min.js"></script>
2
+ <script src="https://cdn.jsdelivr.net/npm/dayjs/plugin/customParseFormat.js"></script>
3
+ <script src="https://cdn.jsdelivr.net/npm/dayjs/plugin/relativeTime.js"></script>
4
4
  <script>
5
5
  $(document).ready(function () {
6
6
  var time_formats = ['YYYY-MM-DD HH:mm:ss ZZ', 'YYYY DD MMM HH:mm:ss ZZ', 'YYYY年MM月DD日 HH:mm:ss ZZ'];
@@ -0,0 +1,3 @@
1
+ {% if site.ackee %}
2
+ <script async src="{{ site.ackee_url }}/{{ site.ackee_js | default: 'tracker.js' }}" data-ackee-server="{{ site.ackee_url }}" data-ackee-domain-id="{{ site.ackee_id }}"></script>
3
+ {% endif %}
@@ -1,3 +1,8 @@
1
1
  {% include plugins/analytics/google.html %}
2
2
  {% include plugins/analytics/umami.html %}
3
+ {% include plugins/analytics/shynet.html %}
4
+ {% include plugins/analytics/plausible.html %}
5
+ {% include plugins/analytics/fathom.html %}
6
+ {% include plugins/analytics/ackee.html %}
7
+ {% include plugins/analytics/matomo.html %}
3
8
  {% include plugins/analytics/busuanzi.html %}
@@ -0,0 +1,3 @@
1
+ {% if site.fathom %}
2
+ <script src="https://cdn.usefathom.com/script.js" data-site="{{ site.fathom_id }}" defer></script>
3
+ {% endif %}
@@ -0,0 +1,14 @@
1
+ {% if site.matomo %}
2
+ <script type="text/javascript">
3
+ var _paq = window._paq = window._paq || [];
4
+ _paq.push(['trackPageView']);
5
+ _paq.push(['enableLinkTracking']);
6
+ (function () {
7
+ var u = "{{ site.mamoto_url }}/";
8
+ _paq.push(['setTrackerUrl', u + 'matomo.php']);
9
+ _paq.push(['setSiteId', "{{ site.mamoto_id }}"]);
10
+ var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
11
+ g.type = 'text/javascript'; g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s);
12
+ })();
13
+ </script>
14
+ {% endif %}
@@ -0,0 +1,4 @@
1
+ {% if site.plausible %}
2
+ <script defer data-domain="{{ site.plausible_domain }}" data-api="{{ site.plausible_url }}/event"
3
+ src="{{ site.plausible_url }}/{{ site.plausible_js | default: 'js/plausible.js' }}"></script>
4
+ {% endif %}
@@ -0,0 +1,6 @@
1
+ {% if site.shynet %}
2
+ <noscript>
3
+ <img src="{{ site.shynet_url }}/pixel.gif">
4
+ </noscript>
5
+ <script defer src="{{ site.shynet_url }}/script.js"></script>
6
+ {% endif %}
@@ -0,0 +1,3 @@
1
+ {% if site.comments.artalk or page.comments.artalk %}
2
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/artalk/dist/Artalk.min.css">
3
+ {% endif %}
@@ -0,0 +1,16 @@
1
+ {% if page.comments.artalk or site.comments.artalk and layout.type == "post" %}
2
+ <script src="https://cdn.jsdelivr.net/npm/artalk/dist/Artalk.min.js"></script>
3
+ <script>
4
+ $(document).ready(function () {
5
+ if ($("#artalk").length > 0) {
6
+ Artalk.init({
7
+ el: '#artalk',
8
+ pageKey: '{{ page.url }}',
9
+ server: '{{ site.comments.artalk_url }}',
10
+ site: '{{ site.comments.artalk_name }}',
11
+ uaBadge: '{% if site.comments.artalk_uaBadge %}{{ site.comments.artalk_uaBadge }}{% else %}true{% endif %}'
12
+ });
13
+ }
14
+ });
15
+ </script>
16
+ {% endif %}
@@ -1,5 +1,61 @@
1
+ {% assign page_comments = "" %}
2
+ {% assign page_comments_num = 0 %}
3
+ {% if page.comments.disqus %}
4
+ {% assign page_comments = page_comments | append: "disqus, " %}
5
+ {% assign page_comments_num = page_comments_num | plus: 1 %}
6
+ {% endif %}
7
+ {% if page.comments.waline %}
8
+ {% assign page_comments = page_comments | append: "waline, " %}
9
+ {% assign page_comments_num = page_comments_num | plus: 1 %}
10
+ {% endif %}
11
+ {% if page.comments.artalk %}
12
+ {% assign page_comments = page_comments | append: "artalk, " %}
13
+ {% assign page_comments_num = page_comments_num | plus: 1 %}
14
+ {% endif %}
15
+ {% if page.comments.utterances %}
16
+ {% assign page_comments = page_comments | append: "utterances, " %}
17
+ {% assign page_comments_num = page_comments_num | plus: 1 %}
18
+ {% endif %}
19
+ {% if page.comments.giscus %}
20
+ {% assign page_comments = page_comments | append: "giscus, " %}
21
+ {% assign page_comments_num = page_comments_num | plus: 1 %}
22
+ {% endif %}
23
+ {% if page.comments.twikoo %}
24
+ {% assign page_comments = page_comments | append: "twikoo, " %}
25
+ {% assign page_comments_num = page_comments_num | plus: 1 %}
26
+ {% endif %}
27
+ {% assign page_comments = page_comments | split: ", " %}
28
+
29
+ {% assign total_comments = "" %}
30
+ {% assign total_comments_num = 0 %}
31
+ {% if page.comments.disqus or site.comments.disqus and page.comments.disqus == nil %}
32
+ {% assign total_comments = total_comments | append: "disqus, " %}
33
+ {% assign total_comments_num = total_comments_num | plus: 1 %}
34
+ {% endif %}
35
+ {% if page.comments.waline or site.comments.waline and page.comments.waline == nil %}
36
+ {% assign total_comments = total_comments | append: "waline, " %}
37
+ {% assign total_comments_num = total_comments_num | plus: 1 %}
38
+ {% endif %}
39
+ {% if page.comments.artalk or site.comments.artalk and page.comments.artalk == nil %}
40
+ {% assign total_comments = total_comments | append: "artalk, " %}
41
+ {% assign total_comments_num = total_comments_num | plus: 1 %}
42
+ {% endif %}
43
+ {% if page.comments.utterances or site.comments.utterances and page.comments.utterances == nil %}
44
+ {% assign total_comments = total_comments | append: "utterances, " %}
45
+ {% assign total_comments_num = total_comments_num | plus: 1 %}
46
+ {% endif %}
47
+ {% if page.comments.giscus or site.comments.giscus and page.comments.giscus == nil %}
48
+ {% assign total_comments = total_comments | append: "giscus, " %}
49
+ {% assign total_comments_num = total_comments_num | plus: 1 %}
50
+ {% endif %}
51
+ {% if page.comments.twikoo or site.comments.twikoo and page.comments.twikoo == nil %}
52
+ {% assign total_comments = total_comments | append: "twikoo, " %}
53
+ {% assign total_comments_num = total_comments_num | plus: 1 %}
54
+ {% endif %}
55
+ {% assign total_comments = total_comments | split: ", " %}
56
+
1
57
  {% capture block %}
2
- <section class="post-footer-item comment">
58
+ <section class="post-footer-item comment comment-switch">
3
59
  <div class="comments-headline">
4
60
  <svg class="icon" aria-hidden="true">
5
61
  <use xlink:href="#icon-comment"></use>
@@ -7,61 +63,146 @@
7
63
  <span>{{ locales.post.comment }}</span>
8
64
  </div>
9
65
  {% if layout.type == "post" %}
10
- {% if site.comments.disqus and site.comments.waline %}
66
+ {% if total_comments_num >= 2 %}
11
67
  <div id="comments-switch">
12
- <span class="first-comment">Disqus</span>
68
+ <span class="first-comment">{{ total_comments[0] | capitalize }}</span>
13
69
  <span class="switch-button">
14
70
  <input id="cmn-toggle-4" class="cmn-toggle cmn-toggle-round-flat" type="checkbox">
15
71
  <label for="cmn-toggle-4"></label>
16
72
  </span>
17
- <span class="second-comment">Waline</span>
73
+ <span class="second-comment">{{ total_comments[1] | capitalize }}</span>
18
74
  </div>
19
75
  {% endif %}
20
76
  {% else %}
21
- {% if page.comments.disqus and page.comments.waline %}
77
+ {% if page_comments_num >= 2 %}
22
78
  <div id="comments-switch">
23
- <span class="first-comment">Disqus</span>
79
+ <span class="first-comment">{{ page_comments[0] | capitalize }}</span>
24
80
  <span class="switch-button">
25
81
  <input id="cmn-toggle-4" class="cmn-toggle cmn-toggle-round-flat" type="checkbox">
26
82
  <label for="cmn-toggle-4"></label>
27
83
  </span>
28
- <span class="second-comment">Waline</span>
84
+ <span class="second-comment">{{ page_comments[1] | capitalize }}</span>
29
85
  </div>
30
86
  {% endif %}
31
87
  {% endif %}
32
88
  </section>
33
89
  {% endcapture %}
34
90
 
91
+ {% capture disqus_block %}
92
+ <section class="post-footer-item comment">
93
+ <div id="disqus_thread"></div>
94
+ </section>
95
+ {% endcapture %}
96
+
97
+ {% capture waline_block %}
98
+ <section class="post-footer-item comment">
99
+ <div id="waline"></div>
100
+ </section>
101
+ {% endcapture %}
102
+
103
+ {% capture artalk_block %}
104
+ <section class="post-footer-item comment">
105
+ <div id="artalk"></div>
106
+ </section>
107
+ {% endcapture %}
108
+
109
+ {% capture utterances_block %}
110
+ <section class="post-footer-item comment">
111
+ {% include plugins/comments/utterances_js.html %}
112
+ </section>
113
+ {% endcapture %}
114
+
115
+ {% capture giscus_block %}
116
+ <section class="post-footer-item comment">
117
+ <div class="giscus"></div>
118
+ </section>
119
+ {% endcapture %}
120
+
121
+ {% capture twikoo_block %}
122
+ <section class="post-footer-item comment">
123
+ <div id="twikoo"></div>
124
+ </section>
125
+ {% endcapture %}
126
+
35
127
  {% if layout.type == "post" %}
36
- {% if site.comments.disqus or site.comments.waline or page.comments.waline or page.comments.disqus %}
128
+ {% if total_comments_num > 0 %}
37
129
  {{ block }}
38
130
  {% endif %}
39
131
  {% else %}
40
- {% if page.comments.disqus or page.comments.waline %}
132
+ {% if page_comments_num > 0 %}
41
133
  {{ block }}
42
134
  {% endif %}
43
135
  {% endif %}
44
136
 
45
137
  {% if layout.type == "post" %}
46
- {% if site.comments.disqus %}
47
- <section class="post-footer-item comment">
48
- <div id="disqus_thread"></div>
49
- </section>
50
- {% endif %}
51
- {% if site.comments.waline %}
52
- <section class="post-footer-item comment">
53
- <div id="waline"></div>
54
- </section>
138
+ {% if total_comments_num >= 2 %}
139
+ {% for comments in total_comments limit: 2 %}
140
+ {% if comments == "disqus" %}
141
+ {{ disqus_block }}
142
+ {% elsif comments == "waline" %}
143
+ {{ waline_block }}
144
+ {% elsif comments == "artalk" %}
145
+ {{ artalk_block }}
146
+ {% elsif comments == "utterances" %}
147
+ {{ utterances_block }}
148
+ {% elsif comments == "giscus" %}
149
+ {{ giscus_block }}
150
+ {% elsif comments == "twikoo" %}
151
+ {{ twikoo_block }}
152
+ {% endif %}
153
+ {% endfor %}
154
+ {% elsif total_comments_num > 0 %}
155
+ {% for comments in total_comments %}
156
+ {% if comments == "disqus" %}
157
+ {{ disqus_block }}
158
+ {% elsif comments == "waline" %}
159
+ {{ waline_block }}
160
+ {% elsif comments == "artalk" %}
161
+ {{ artalk_block }}
162
+ {% elsif comments == "utterances" %}
163
+ {{ utterances_block }}
164
+ {% elsif comments == "giscus" %}
165
+ {{ giscus_block }}
166
+ {% elsif comments == "twikoo" %}
167
+ {{ twikoo_block }}
168
+ {% endif %}
169
+ {% endfor %}
55
170
  {% endif %}
56
171
  {% else %}
57
- {% if page.comments.disqus %}
58
- <section class="post-footer-item comment">
59
- <div id="disqus_thread"></div>
60
- </section>
61
- {% endif %}
62
- {% if page.comments.waline %}
63
- <section class="post-footer-item comment">
64
- <div id="waline"></div>
65
- </section>
172
+ {% if page_comments_num >= 2 %}
173
+ {% for comments in page_comments limit: 2 %}
174
+ {% if comments == "disqus" %}
175
+ {{ disqus_block }}
176
+ {% elsif comments == "waline" %}
177
+ {{ waline_block }}
178
+ {% elsif comments == "artalk" %}
179
+ {{ artalk_block }}
180
+ {% elsif comments == "utterances" %}
181
+ {{ utterances_block }}
182
+ {% elsif comments == "giscus" %}
183
+ {{ giscus_block }}
184
+ {% elsif comments == "twikoo" %}
185
+ {{ twikoo_block }}
186
+ {% endif %}
187
+ {% endfor %}
188
+ {% else %}
189
+ {% if page.comments.disqus %}
190
+ {{ disqus_block }}
191
+ {% endif %}
192
+ {% if page.comments.waline %}
193
+ {{ waline_block }}
194
+ {% endif %}
195
+ {% if page.comments.artalk %}
196
+ {{ artalk_block }}
197
+ {% endif %}
198
+ {% if page.comments.utterances %}
199
+ {{ utterances_block }}
200
+ {% endif %}
201
+ {% if page.comments.giscus %}
202
+ {{ giscus_block }}
203
+ {% endif %}
204
+ {% if page.comments.twikoo %}
205
+ {{ twikoo_block }}
206
+ {% endif %}
66
207
  {% endif %}
67
208
  {% endif %}
@@ -1,23 +1,24 @@
1
1
  {% include plugins/comments/disqus.html %}
2
2
  {% include plugins/comments/waline_js.html %}
3
+ {% include plugins/comments/artalk_js.html %}
4
+ {% include plugins/comments/giscus_js.html %}
5
+ {% include plugins/comments/twikoo_js.html %}
3
6
  <script>
4
7
  $(document).ready(function () {
5
- if ($("#comments-switch").length > 0) {
8
+ if ($(".comment").length == 3) {
6
9
  var comment_status = $("#cmn-toggle-4")[0].checked;
7
10
  if (comment_status) {
8
- $("#waline").addClass("active");
11
+ $(".comment:last > div").addClass("active");
9
12
  } else {
10
- $("#disqus_thread").addClass("active");
13
+ $(".comment:nth-last-child(2) > div").addClass("active");
11
14
  }
12
15
  $("#cmn-toggle-4").click(function () {
13
- $("#disqus_thread").toggleClass("active");
14
- $("#waline").toggleClass("active");
16
+ $(".comment:nth-last-child(2) > div").toggleClass("active");
17
+ $(".comment:last > div").toggleClass("active");
15
18
  })
16
19
  } else {
17
- if ($("#disqus_thread").length > 0) {
18
- $("#disqus_thread").addClass("active");
19
- } else if ($("#waline").length > 0) {
20
- $("#waline").addClass("active");
20
+ if ($(".comment").length == 2) {
21
+ $(".comment:last > div").addClass("active")
21
22
  }
22
23
  }
23
24
  })
@@ -1,4 +1,4 @@
1
- {% if site.comments.disqus or page.comments.disqus %}
1
+ {% if page.comments.utterances or site.comments.disqus and layout.type == "post" %}
2
2
  <script>
3
3
  /**
4
4
  * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
@@ -0,0 +1,54 @@
1
+ {% if page.comments.giscus or site.comments.giscus and layout.type == "post" %}
2
+ <script>
3
+ function getCookie(cname) {
4
+ var name = cname + "=";
5
+ var ca = document.cookie.split(';');
6
+ for (var i = 0; i < ca.length; i++) {
7
+ var c = ca[i].trim();
8
+ if (c.indexOf(name) === 0) return c.substring(name.length, c.length);
9
+ }
10
+ return "";
11
+ }
12
+
13
+ function changeGiscusTheme() {
14
+ const theme = getCookie("mode") === 'night' ? 'dark' : 'light'
15
+ const url = "{{ site.comments.giscus_url | default: 'https://giscus.app/client.js' }}"
16
+ const baseUrl = url.split('/').slice(0, 3).join('/')
17
+
18
+ function sendMessage(message) {
19
+ const iframe = document.querySelector('iframe.giscus-frame');
20
+ if (!iframe) return;
21
+ iframe.contentWindow.postMessage({ giscus: message }, baseUrl);
22
+ }
23
+
24
+ sendMessage({
25
+ setConfig: {
26
+ theme: theme
27
+ }
28
+ });
29
+ }
30
+
31
+ if ($(".giscuss").length > 0){
32
+ document.addEventListener("DOMContentLoaded", function() {
33
+ const n = {
34
+ src: "{{ site.comments.giscus_url | default: 'https://giscus.app/client.js' }}",
35
+ "data-repo": "{{ site.comments.giscus_repo }}",
36
+ "data-repo-id": "{{ site.comments.giscus_repo_id }}",
37
+ "data-category-id": "{{ site.comments.giscus_category_id }}",
38
+ "data-mapping": "{{ site.comments.giscus_mapping | default: 'pathname' }}",
39
+ "data-strict": "1",
40
+ "data-reactions-enabled": "1",
41
+ "data-emit-metadata": "0",
42
+ "data-input-position": "top",
43
+ "data-theme": getCookie("mode") === 'night' ? 'dark' : 'light',
44
+ "data-lang": "{{ site.comments.giscus_lang | default: 'zh-CN' }}",
45
+ "data-loading": "lazy",
46
+ crossorigin: "anonymous",
47
+ async: ""
48
+ }, e = document.createElement("script");
49
+ Object.entries(n).forEach( ([t,n]) => e.setAttribute(t, n)),
50
+ document.body.appendChild(e);
51
+ });
52
+ }
53
+ </script>
54
+ {% endif %}
@@ -0,0 +1,13 @@
1
+ {% if page.comments.twikoo or site.comments.twikoo and layout.type == "post" %}
2
+ <script src="https://cdn.jsdelivr.net/npm/twikoo@1.6.39/dist/twikoo.all.min.js"></script>
3
+ <script>
4
+ if ($("#twikoo").length > 0) {
5
+ twikoo.init({
6
+ envId: "{{ site.comments.twikoo_url }}",
7
+ el: "#twikoo",
8
+ region: "{{ site.comments.twikoo_region | default: '' }}",
9
+ lang: "{{ site.comments.twikoo_lang | default: 'zh-CN' }}"
10
+ });
11
+ }
12
+ </script>
13
+ {% endif %}
@@ -0,0 +1,10 @@
1
+ {% if page.comments.utterances or site.comments.utterances and layout.type == "post" %}
2
+ <script src="{{ site.comments.utterances_url }}"
3
+ repo="{{ site.comments.utterances_repo }}"
4
+ issue-term="{{ site.comments.utterances_issue_term | default: 'pathname' }}"
5
+ label="{{ site.comments.utterances_label | default: '' }}"
6
+ theme="{{ site.comments.utterances_theme | default: 'github-light' }}"
7
+ crossorigin="anonymous"
8
+ async>
9
+ </script>
10
+ {% endif %}
@@ -1,4 +1,4 @@
1
- {% if site.comments.waline or page.comments.waline %}
1
+ {% if page.comments.waline or site.comments.waline and layout.type == "post" %}
2
2
  <script src="https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.umd.js"></script>
3
3
  <script>
4
4
  $(document).ready(function () {
@@ -1 +1 @@
1
- <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.min.css" />
1
+ <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css">