hexo-theme-volantis 5.2.0 → 5.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.3.0](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.2.0...v5.3.0) (2022-05-22)
4
+
5
+
6
+ ### Features
7
+
8
+ * **meta:** add artalk comment count ([75c5eeb](https://github.com/volantis-x/hexo-theme-volantis/commit/75c5eeb688d52289f466d8e26b84352d7dae74b9))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **artalk:** fancybox/darkmode ([c03684d](https://github.com/volantis-x/hexo-theme-volantis/commit/c03684dd6d7feced55969bddc4c357a65ec0333c))
14
+ * **meta_library:** counter ([7d42316](https://github.com/volantis-x/hexo-theme-volantis/commit/7d42316a80909125938774b9685b4962486ecc65))
15
+
3
16
  ## [5.2.0](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.1.1...v5.2.0) (2022-05-21)
4
17
 
5
18
 
package/_config.yml CHANGED
@@ -176,6 +176,9 @@ article:
176
176
  # 文章顶部信息
177
177
  # 从 meta_library 中取
178
178
  top_meta: [author, category, date, counter] #启用评论数量需在此添加
179
+ # 文章底部信息
180
+ # 从 meta_library 中取
181
+ bottom_meta: [updated, tags, share]
179
182
  # ----------------
180
183
  # 文章页脚组件
181
184
  footer_widget:
@@ -214,9 +217,6 @@ article:
214
217
  images:
215
218
  - volantis-static/media/org.volantis/blog/qrcode/github@volantis.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/blog/qrcode/github@volantis.png
216
219
  - volantis-static/media/org.volantis/blog/qrcode/github@volantis.png # https://cdn.jsdelivr.net/gh/volantis-x/cdn-org/blog/qrcode/github@volantis.png
217
- # 文章底部信息
218
- # 从 meta_library 中取
219
- bottom_meta: [updated, tags, share]
220
220
  # meta library
221
221
  meta_library:
222
222
  # 默认文章作者(可在 _data/author.yaml 中增加其他作者,并在 front-matter 中设置)
@@ -245,7 +245,11 @@ article:
245
245
  # waline 文章评论数量
246
246
  walinecount:
247
247
  icon: fa-solid fa-comment-dots
248
- desc: '' # 条评论
248
+ desc: '条评论' # 条评论
249
+ # artalk 文章评论数量
250
+ artalkcount:
251
+ icon: fa-solid fa-comment-dots
252
+ desc: '条评论' # 条评论
249
253
  # 文章字数和阅读时长
250
254
  wordcount:
251
255
  icon_wordcount: fa-solid fa-keyboard
@@ -604,8 +608,8 @@ site_footer:
604
608
  source: https://github.com/volantis-x/volantis-docs/
605
609
  # analytics using leancloud
606
610
  analytics: >
607
- <span id="lc-sv">本站总访问量为 <span id='number'><i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i></span> 次</span>
608
- <span id="lc-uv">访客数为 <span id='number'><i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i></span> 人</span>
611
+ <span id="lc-sv">本站总访问量为 <span id='number'><i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i></span> 次</span>
612
+ <span id="lc-uv">访客数为 <span id='number'><i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i></span> 人</span>
609
613
  # site copyright
610
614
  copyright: '[Copyright © since 2017 XXX](/)'
611
615
  # You can add your own property here. (Support markdown, for example: br: '<br>')
@@ -0,0 +1,22 @@
1
+ <% if (theme.comments.service == 'artalk'){ %>
2
+ <div class="new-meta-item comments-count">
3
+ <%
4
+ var path = post.path || page.path;
5
+ if (path.length > 9 && (path.substring(path.length - 10) == 'index.html')) {
6
+ path = path.substring(0, path.length - 10);
7
+ }
8
+ if(!!theme.comments.artalk.path) path = theme.comments.artalk.path
9
+ %>
10
+ <a href="<%- url_for(path) %>#comments">
11
+ <i class="<%- theme.article.body.meta_library.artalkcount.icon %> fa-fw"></i>
12
+ <p>
13
+ <span data-page-key="<%- url_for(path) %>" id="ArtalkCount">
14
+ <i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i>
15
+ </span>
16
+ <% if(theme.article.body.meta_library.artalkcount.desc) { %>
17
+ <span class="leancloud-comments-count">&nbsp;<%- theme.article.body.meta_library.artalkcount.desc %></span>
18
+ <% } %>
19
+ </p>
20
+ </a>
21
+ </div>
22
+ <% } %>
@@ -1,78 +1,40 @@
1
- <% if (theme.analytics && theme.analytics.leancloud && theme.analytics.leancloud.app_id) { %>
2
- <div class="new-meta-item browse leancloud">
3
- <a class='notlink'>
4
- <%
5
- var path = post.path || page.path;
6
- if (path.length > 9 && (path.substring(path.length - 10) == 'index.html')) {
7
- path = path.substring(0, path.length - 10);
8
- }
9
- %>
10
- <div id="lc-pv" data-title="<%- post.title || page.title %>" data-path="<%- url_for(path) %>">
11
- <i class="<%- theme.article.body.meta_library.counter.icon %> fa-fw" aria-hidden="true"></i>
12
- <span id='number'><i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i></span>
13
- <%- theme.article.body.meta_library.counter.unit %>
14
- </div>
15
- </a>
16
- </div>
17
- <% } else if (theme.analytics.busuanzi) { %>
18
- <div class="new-meta-item browse busuanzi">
19
- <a class='notlink'>
1
+ <%
2
+ let path = post.path || page.path;
3
+ if (path.length > 9 && (path.substring(path.length - 10) == 'index.html')) {
4
+ path = path.substring(0, path.length - 10);
5
+ }
6
+ %>
7
+
8
+ <% if (!!page.comments) { %>
9
+ <div class="new-meta-item browse">
10
+ <a class='notlink'>
11
+ <p>
20
12
  <i class="<%- theme.article.body.meta_library.counter.icon %> fa-fw" aria-hidden="true"></i>
21
- <p>
22
- <span id="busuanzi_value_page_pv">
23
- <i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i>
24
- </span>
25
- <%- theme.article.body.meta_library.counter.unit %>
26
- </p>
27
- </a>
28
- </div>
29
- <% } else if (theme.comments.service=='waline' && theme.comments.waline.pageview) { %>
30
- <div class="new-meta-item browse">
31
- <a class='notlink'>
32
- <i class="<%- theme.article.body.meta_library.counter.icon %> fa-fw" aria-hidden="true"></i>
33
- <%
34
- var path = post.path || page.path;
35
- if (path.length > 9 && (path.substring(path.length - 10) == 'index.html')) {
36
- path = path.substring(0, path.length - 10);
37
- }
38
- %>
39
- <span data-path="<%- url_for(path) %>" class="waline-pageview-count"></span>
40
- </a>
41
- </div>
42
- <% } else if (theme.comments.service=='twikoo' && !!page.comments) { %>
43
- <div class="new-meta-item browse">
44
- <a class='notlink'>
45
- <i class="<%- theme.article.body.meta_library.counter.icon %> fa-fw" aria-hidden="true"></i>
46
- <p>
47
- <span id="twikoo_visitors">
48
- <i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i>
49
- </span>
50
- </p>
13
+ <% if (theme.analytics && theme.analytics.leancloud && theme.analytics.leancloud.app_id) { %>
14
+ <span id="lc-pv" data-title="<%- post.title || page.title %>" data-path="<%- url_for(path) %>">
15
+ <span id='number'><i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i></span>
51
16
  </span>
52
- </a>
53
- </div>
54
- <% } else if (theme.comments.service=='discuss' && !!page.comments) { %>
55
- <div class="new-meta-item browse">
56
- <a class='notlink'>
57
- <i class="<%- theme.article.body.meta_library.counter.icon %> fa-fw" aria-hidden="true"></i>
58
- <p>
59
- <span id="Discuss-Visitors">
60
- <i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i>
61
- </span>
62
- </p>
17
+ <% } else if (theme.analytics.busuanzi) { %>
18
+ <span id="busuanzi_value_page_pv"><i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i></span>
19
+ <% } else if (theme.comments.service=='waline' && theme.comments.waline.pageview) { %>
20
+ <span data-path="<%- url_for(path) %>" class="waline-pageview-count">
21
+ <i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i>
22
+ </span>
23
+ <% } else if (theme.comments.service=='twikoo') { %>
24
+ <span id="twikoo_visitors">
25
+ <i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i>
26
+ </span>
27
+ <% } else if (theme.comments.service=='discuss') { %>
28
+ <span id="Discuss-Visitors">
29
+ <i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i>
30
+ </span>
31
+ <% } else if (theme.comments.service=='artalk') { %>
32
+ <span id="artalk_visitors" data-page-key="<%- url_for(path) %>">
33
+ <i class="fa-light fa-loader fa-spin fa-fw" aria-hidden="true"></i>
63
34
  </span>
64
- </a>
65
- </div>
66
- <% } else if (theme.comments.service=='artalk' && !!page.comments) { %>
67
- <div class="new-meta-item browse">
68
- <a class='notlink'>
69
- <i class="<%- theme.article.body.meta_library.counter.icon %> fa-fw" aria-hidden="true"></i>
70
- <p>
71
- <span id="artalk_visitors">
72
- <i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i>
73
- </span>
74
- <%- theme.article.body.meta_library.counter.unit %>
75
- </p>
76
- </a>
77
- </div>
35
+ <% } %>
36
+ <span><%- theme.article.body.meta_library.counter.unit %></span>
37
+ </p>
38
+ </a>
39
+ </div>
78
40
  <% } %>
@@ -9,8 +9,14 @@
9
9
  %>
10
10
  <a href="<%- url_for(path) %>#comments">
11
11
  <i class="<%- theme.article.body.meta_library.walinecount.icon %> fa-fw"></i>
12
- <span data-path="<%- url_for(path) %>" class="waline-comment-count"></span>
13
- <span class="leancloud-comments-count">&nbsp;<%- theme.article.body.meta_library.walinecount.desc %></span>
12
+ <p>
13
+ <span data-path="<%- url_for(path) %>" class="waline-comment-count">
14
+ <i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i>
15
+ </span>
16
+ <% if(theme.article.body.meta_library.walinecount.desc) { %>
17
+ <span class="leancloud-comments-count">&nbsp;<%- theme.article.body.meta_library.walinecount.desc %></span>
18
+ <% } %>
19
+ </p>
14
20
  </a>
15
21
  </div>
16
22
  <% } %>
@@ -41,7 +41,7 @@
41
41
  <%- __('footer.use') %>
42
42
  <a href="https://github.com/volantis-x/hexo-theme-volantis/tree/<%- theme_version %>" target="_blank" class="codename">Volantis</a>
43
43
  <%- __('footer.theme') %><% if (theme.analytics.busuanzi) { %><%- __('symbol.comma') %><%- __('footer.total_views') %>
44
- <span id="busuanzi_value_site_pv"><i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i></span>
44
+ <span id="busuanzi_value_site_pv"><i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i></span>
45
45
  <%- __('footer.times') %>
46
46
  <% } %>
47
47
  <% } else if (item == 'source') { %>
@@ -17,7 +17,7 @@
17
17
  path = path.replaceAll('/index.html', '/')
18
18
  }
19
19
 
20
- volantis.artalk = new Artalk(Object.assign(<%- JSON.stringify(theme.comments.artalk) %>, {
20
+ new Artalk(Object.assign(<%- JSON.stringify(theme.comments.artalk) %>, {
21
21
  el: '#artalk_container',
22
22
  pageKey: path,
23
23
  pageTitle: document.title,
@@ -46,8 +46,8 @@
46
46
  <% } %>
47
47
  }));
48
48
 
49
- volantis.artalk.then(ctx => {
50
- ctx.on('comments-loaded', () => {
49
+ Artalk.Use(ctx => {
50
+ ctx.on('list-loaded', () => {
51
51
  if (typeof VolantisFancyBox === "undefined"){
52
52
  const checkFancyBox = setInterval(() => {
53
53
  if(typeof VolantisFancyBox === "undefined") return;
@@ -72,7 +72,7 @@
72
72
 
73
73
  function dark_artalk() {
74
74
  if(!document.querySelectorAll("#artalk_container")[0]) return;
75
- volantis.artalk.then(ctx => {
75
+ Artalk.Use(ctx => {
76
76
  ctx.setDarkMode(volantis.dark.mode === "dark")
77
77
  })
78
78
  }
@@ -31,7 +31,7 @@
31
31
  <% if (!!theme.analytics.busuanz) {%>
32
32
  <div><span id="busuanzi_value_site_uv"><i class="fa-solid fa-fan fa-spin fa-fw" aria-hidden="true"></i></span> <%= item.type.visitcounter.siteuv.unit %></div>
33
33
  <% } else { %>
34
- <div><span id="lc-uv"><span id='number'><i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i></span></span> <%= item.type.visitcounter.siteuv.unit %></div>
34
+ <div><span id="lc-uv"><span id='number'><i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i></span></span> <%= item.type.visitcounter.siteuv.unit %></div>
35
35
  <% } %>
36
36
  </div>
37
37
  <% } %>
@@ -42,7 +42,7 @@
42
42
  <% if (!!theme.analytics.busuanz) {%>
43
43
  <div><span id="busuanzi_value_site_pv"><i class="fa-solid fa-fan fa-spin fa-fw" aria-hidden="true"></i></span> <%= item.type.visitcounter.sitepv.unit %></div>
44
44
  <% } else { %>
45
- <div><span id="lc-sv"><span id='number'><i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i></span></span> <%= item.type.visitcounter.sitepv.unit %></div>
45
+ <div><span id="lc-sv"><span id='number'><i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i></span></span> <%= item.type.visitcounter.sitepv.unit %></div>
46
46
  <% } %>
47
47
  </div>
48
48
  <% } %>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-volantis",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -185,7 +185,7 @@
185
185
  &:last-child
186
186
  margin-right: 0
187
187
  img,i
188
- display: inline
188
+ display: inline-block
189
189
  i
190
190
  margin-right: 4px
191
191
  border-radius: 0