hexo-theme-volantis 5.1.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,32 @@
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
+
16
+ ## [5.2.0](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.1.1...v5.2.0) (2022-05-21)
17
+
18
+
19
+ ### Features
20
+
21
+ * **artalk:** Add support for using custom imgUploader ([b69c502](https://github.com/volantis-x/hexo-theme-volantis/commit/b69c502565d8b4d6d1ad1a58fdc3fc00ac200cef))
22
+
23
+ ### [5.1.1](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.1.0...v5.1.1) (2022-05-19)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * **#761:** overflow ([74e0d04](https://github.com/volantis-x/hexo-theme-volantis/commit/74e0d04a47d17c513f0d29ecaceb49b51d63ee18))
29
+
3
30
  ## [5.1.0](https://github.com/volantis-x/hexo-theme-volantis/compare/5.0.0...v5.1.0) (2022-05-19)
4
31
 
5
32
 
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  </p>
4
4
 
5
5
  [![](https://img.shields.io/npm/v/hexo-theme-volantis.svg?style=flat-square)](https://www.npmjs.com/package/hexo-theme-volantis)
6
+ [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://www.conventionalcommits.org/zh-hans/v1.0.0/)
6
7
 
7
8
  ## Getting Started
8
9
 
package/_config.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  ############################### Volantis ###############################
2
2
  info:
3
3
  theme_name: Volantis # This is theme's name.
4
- theme_version: '5.0.0-alpha.112' # This is theme's version.
5
4
  theme_docs: https://volantis.js.org/ # This is theme's URL.
6
5
  theme_repo: https://github.com/volantis-x/hexo-theme-volantis
7
6
  # Debug 调试模式
@@ -177,6 +176,9 @@ article:
177
176
  # 文章顶部信息
178
177
  # 从 meta_library 中取
179
178
  top_meta: [author, category, date, counter] #启用评论数量需在此添加
179
+ # 文章底部信息
180
+ # 从 meta_library 中取
181
+ bottom_meta: [updated, tags, share]
180
182
  # ----------------
181
183
  # 文章页脚组件
182
184
  footer_widget:
@@ -215,9 +217,6 @@ article:
215
217
  images:
216
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
217
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
218
- # 文章底部信息
219
- # 从 meta_library 中取
220
- bottom_meta: [updated, tags, share]
221
220
  # meta library
222
221
  meta_library:
223
222
  # 默认文章作者(可在 _data/author.yaml 中增加其他作者,并在 front-matter 中设置)
@@ -246,7 +245,11 @@ article:
246
245
  # waline 文章评论数量
247
246
  walinecount:
248
247
  icon: fa-solid fa-comment-dots
249
- desc: '' # 条评论
248
+ desc: '条评论' # 条评论
249
+ # artalk 文章评论数量
250
+ artalkcount:
251
+ icon: fa-solid fa-comment-dots
252
+ desc: '条评论' # 条评论
250
253
  # 文章字数和阅读时长
251
254
  wordcount:
252
255
  icon_wordcount: fa-solid fa-keyboard
@@ -285,9 +288,19 @@ comments:
285
288
  server: https://yours-artalk-domain # 修改为自建的后端服务地址
286
289
  path: # 全局评论地址
287
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: # 图片地址返回值的字段
288
301
  # 更多置项可在 Artalk 后端进行配置,详见 https://artalk.js.org/guide/backend/fe-control.html
289
302
  # 也可以在此处继续参考上方例子进行配置,不建议重写配置的字段除上方所述外还有:
290
- # [el, useBackendConf, pageKey, pageTitle, site, darkMode, pvEl]
303
+ # [el, useBackendConf, pageKey, pageTitle, site, darkMode, pvEl, imgUploader]
291
304
 
292
305
  # giscus
293
306
  # https://giscus.app
@@ -595,8 +608,8 @@ site_footer:
595
608
  source: https://github.com/volantis-x/volantis-docs/
596
609
  # analytics using leancloud
597
610
  analytics: >
598
- <span id="lc-sv">本站总访问量为 <span id='number'><i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i></span> 次</span>
599
- <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>
600
613
  # site copyright
601
614
  copyright: '[Copyright © since 2017 XXX](/)'
602
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') { %>
@@ -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.0",
3
+ "version": "5.3.0",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ const { version } = require('../../../package.json');
4
+
3
5
  function isObject(item) {
4
6
  return item && typeof item === 'object' && !Array.isArray(item);
5
7
  }
@@ -85,4 +87,5 @@ module.exports = hexo => {
85
87
  }
86
88
  }
87
89
  volantis_static_cdn(hexo.theme.config,hexo);
90
+ hexo.theme.config.info.theme_version = version;
88
91
  };
@@ -109,6 +109,8 @@ if hexo-config('comments.service')=='discuss' || hexo-config('comments.service')
109
109
  .blur#comments
110
110
  @supports (backdrop-filter: blur(20px))
111
111
  backdrop-filter: unset
112
+ #layoutHelper-comments
113
+ margin-bottom: 100px
112
114
 
113
115
  .shadow
114
116
  box-shadow: $boxshadow-card
@@ -66,7 +66,7 @@ pre
66
66
  article,aside,details,figcaption,figure,footer,hgroup,main,menu,nav,section,summary
67
67
  display: block
68
68
 
69
- article:not(#comments)
69
+ article
70
70
  overflow: hidden
71
71
 
72
72
  abbr[title]
@@ -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