hexo-theme-volantis 5.1.1 → 5.3.1

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,32 @@
1
1
  # Changelog
2
2
 
3
+ ### [5.3.1](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.3.0...v5.3.1) (2022-05-23)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **bbtalk:** js config ([4bb7a12](https://github.com/volantis-x/hexo-theme-volantis/commit/4bb7a12a8d1ab384a223b946e7da1f3ecf60c9ac))
9
+
10
+ ## [5.3.0](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.2.0...v5.3.0) (2022-05-22)
11
+
12
+
13
+ ### Features
14
+
15
+ * **meta:** add artalk comment count ([75c5eeb](https://github.com/volantis-x/hexo-theme-volantis/commit/75c5eeb688d52289f466d8e26b84352d7dae74b9))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **artalk:** fancybox/darkmode ([c03684d](https://github.com/volantis-x/hexo-theme-volantis/commit/c03684dd6d7feced55969bddc4c357a65ec0333c))
21
+ * **meta_library:** counter ([7d42316](https://github.com/volantis-x/hexo-theme-volantis/commit/7d42316a80909125938774b9685b4962486ecc65))
22
+
23
+ ## [5.2.0](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.1.1...v5.2.0) (2022-05-21)
24
+
25
+
26
+ ### Features
27
+
28
+ * **artalk:** Add support for using custom imgUploader ([b69c502](https://github.com/volantis-x/hexo-theme-volantis/commit/b69c502565d8b4d6d1ad1a58fdc3fc00ac200cef))
29
+
3
30
  ### [5.1.1](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.1.0...v5.1.1) (2022-05-19)
4
31
 
5
32
 
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
@@ -284,9 +288,19 @@ comments:
284
288
  server: https://yours-artalk-domain # 修改为自建的后端服务地址
285
289
  path: # 全局评论地址
286
290
  placeholder: # 评论占位
291
+ # artalk 有三类图片:1.上传至服务端 2.上传至服务端后利用upgit上传至图床 3.前端上传至图床(本配置为此类)
292
+ # 配置此项时将覆盖服务端上传能力
293
+ imgUploader:
294
+ # 以兰空图床为例,下列填写内容为:
295
+ # url: 'https://xxxxxx/api/v1/upload'
296
+ # token: 'Bearer xxxxxxxxxxxxxx'
297
+ # resp: 'data.links.url'
298
+ api: # 图床地址
299
+ token: # 图床验证
300
+ resp: # 图片地址返回值的字段
287
301
  # 更多置项可在 Artalk 后端进行配置,详见 https://artalk.js.org/guide/backend/fe-control.html
288
302
  # 也可以在此处继续参考上方例子进行配置,不建议重写配置的字段除上方所述外还有:
289
- # [el, useBackendConf, pageKey, pageTitle, site, darkMode, pvEl]
303
+ # [el, useBackendConf, pageKey, pageTitle, site, darkMode, pvEl, imgUploader]
290
304
 
291
305
  # giscus
292
306
  # https://giscus.app
@@ -594,8 +608,8 @@ site_footer:
594
608
  source: https://github.com/volantis-x/volantis-docs/
595
609
  # analytics using leancloud
596
610
  analytics: >
597
- <span id="lc-sv">本站总访问量为 <span id='number'><i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i></span> 次</span>
598
- <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>
599
613
  # site copyright
600
614
  copyright: '[Copyright © since 2017 XXX](/)'
601
615
  # You can add your own property here. (Support markdown, for example: br: '<br>')
@@ -827,7 +841,7 @@ plugins:
827
841
  bbtalk:
828
842
  # Set `plugins: ["bbtalk"]` to enable in front-matter
829
843
  # 不支持 Pjax
830
- js: https://unpkg.com/bbtalk@0.1.5/dist/bbtalk.min.js # BBtalk.js
844
+ js: https://unpkg.com/bbtalk@0/dist/bbtalk.js # BBtalk.js
831
845
  appId: 0KzOX4vC7Jsk6vzUGNeEiUaI-gzGzoHsz # your appID
832
846
  appKey: HwCiWuxfpvKiLm4teCUgTIba # your appKEY
833
847
  serverURLs: https://bbapi.heson10.com # Request Api 域名
@@ -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') { %>
@@ -13,8 +13,11 @@
13
13
  if (path.length == 0) {
14
14
  path = '<%= theme.comments.artalk.path %>' || decodeURI(window.location.pathname);
15
15
  }
16
+ if(!'<%= config.permalink %>'.includes('/index.html')) {
17
+ path = path.replaceAll('/index.html', '/')
18
+ }
16
19
 
17
- volantis.artalk = new Artalk(Object.assign(<%- JSON.stringify(theme.comments.artalk) %>, {
20
+ new Artalk(Object.assign(<%- JSON.stringify(theme.comments.artalk) %>, {
18
21
  el: '#artalk_container',
19
22
  pageKey: path,
20
23
  pageTitle: document.title,
@@ -22,11 +25,29 @@
22
25
  useBackendConf: true,
23
26
  site: '<%= config.title %>',
24
27
  darkMode: volantis.dark.mode === "dark",
25
- pvEl: '#artalk_visitors'
28
+ pvEl: '#artalk_visitors',
29
+
30
+ <% if(!!theme.comments.artalk.imgUploader?.api){ %>
31
+ imgUploader: function(file) {
32
+ let headers = new Headers();
33
+ headers.set('Accept', 'application/json');
34
+ <% if(!!theme.comments.artalk.imgUploader?.token) { %>
35
+ headers.set('Authorization', '<%= theme.comments.artalk.imgUploader?.token %>')
36
+ <% } %>
37
+ let formData = new FormData();
38
+ formData.append('file', file);
39
+ return fetch('<%= theme.comments.artalk.imgUploader?.api %>',{
40
+ method: 'POST',
41
+ body: formData,
42
+ headers: headers
43
+ }).then((resp) => resp.json())
44
+ .then((resp) => resp.<%= theme.comments.artalk.imgUploader?.resp %>)
45
+ },
46
+ <% } %>
26
47
  }));
27
48
 
28
- volantis.artalk.then(ctx => {
29
- ctx.on('comments-loaded', () => {
49
+ Artalk.Use(ctx => {
50
+ ctx.on('list-loaded', () => {
30
51
  if (typeof VolantisFancyBox === "undefined"){
31
52
  const checkFancyBox = setInterval(() => {
32
53
  if(typeof VolantisFancyBox === "undefined") return;
@@ -51,7 +72,7 @@
51
72
 
52
73
  function dark_artalk() {
53
74
  if(!document.querySelectorAll("#artalk_container")[0]) return;
54
- volantis.artalk.then(ctx => {
75
+ Artalk.Use(ctx => {
55
76
  ctx.setDarkMode(volantis.dark.mode === "dark")
56
77
  })
57
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.1.1",
3
+ "version": "5.3.1",
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