hexo-theme-volantis 5.0.0-rc.9 → 5.2.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 (62) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +2 -1
  3. package/_config.yml +69 -46
  4. package/layout/_meta/counter.ejs +27 -5
  5. package/layout/_meta/walinecount.ejs +2 -1
  6. package/layout/_partial/article.ejs +2 -2
  7. package/layout/_partial/head.ejs +29 -28
  8. package/layout/_partial/header.ejs +1 -1
  9. package/layout/_partial/scripts/content-visibility-scroll-fix.ejs +71 -69
  10. package/layout/_partial/scripts/global.ejs +47 -23
  11. package/layout/_partial/scripts/index.ejs +22 -9
  12. package/layout/_partial/scripts/toc.ejs +61 -38
  13. package/layout/_plugins/_page_plugins/indent/index.ejs +1 -1
  14. package/layout/_plugins/_page_plugins/index.ejs +27 -7
  15. package/layout/_plugins/_page_plugins/snackbar/index.ejs +1 -1
  16. package/layout/_plugins/analytics/script.ejs +11 -1
  17. package/layout/_plugins/aplayer/script.ejs +1 -1
  18. package/layout/_plugins/comments/artalk/script.ejs +38 -11
  19. package/layout/_plugins/comments/beaudar/script.ejs +2 -2
  20. package/layout/_plugins/comments/discuss/script.ejs +30 -0
  21. package/layout/_plugins/comments/hashover/script.ejs +2 -2
  22. package/layout/_plugins/comments/index.ejs +4 -4
  23. package/layout/_plugins/comments/twikoo/script.ejs +1 -1
  24. package/layout/_plugins/comments/waline/script.ejs +40 -22
  25. package/layout/_plugins/parallax/script.ejs +1 -1
  26. package/layout/_plugins/pjax/index.ejs +4 -1
  27. package/layout/_plugins/rightmenu/layout.ejs +2 -2
  28. package/layout/_plugins/rightmenus/layout.ejs +17 -17
  29. package/layout/_widget/lastupdate.ejs +27 -27
  30. package/layout/_widget/webinfo.ejs +7 -7
  31. package/layout/layout.ejs +20 -3
  32. package/layout/tag.ejs +1 -1
  33. package/package.json +1 -1
  34. package/scripts/events/lib/check-configuration.js +43 -0
  35. package/scripts/events/lib/check-environment.js +20 -1
  36. package/scripts/events/lib/config.js +3 -0
  37. package/scripts/events/lib/render-stylus.js +1 -1
  38. package/scripts/filters/content-visibility.js +2 -2
  39. package/scripts/helpers/custom-files.js +3 -1
  40. package/scripts/helpers/head/generate_seo.js +1 -1
  41. package/scripts/helpers/structured-data/lib/blogposting.js +18 -6
  42. package/scripts/helpers/structured-data/lib/breadcrumblist.js +25 -1
  43. package/scripts/helpers/structured-data/lib/index.js +1 -9
  44. package/scripts/tags/fancybox.js +1 -1
  45. package/scripts/tags/tabs.js +85 -86
  46. package/source/css/_defines/AutoPrefixCSS.styl +16 -16
  47. package/source/css/_first/base_first.styl +6 -0
  48. package/source/css/_first/navbar_first.styl +1 -1
  49. package/source/css/_style/_base/base.styl +1 -1
  50. package/source/css/_style/_layout/toc.styl +2 -2
  51. package/source/css/_style/_plugins/_dark/dark_async.styl +1 -1
  52. package/source/css/_style/_plugins/_dark/dark_plugins.styl +8 -4
  53. package/source/css/_style/_plugins/_rightmenu/reading.styl +2 -2
  54. package/source/css/_style/_plugins/_rightmenu/rightmenu.styl +1 -1
  55. package/source/css/_style/_plugins/fontcolor.styl +1 -1
  56. package/source/css/first.styl +5 -7
  57. package/source/js/app.js +32 -35
  58. package/source/js/plugins/aplayer.js +1 -3
  59. package/source/js/plugins/rightMenu.js +22 -22
  60. package/source/js/plugins/rightMenus.js +115 -78
  61. package/source/js/search/hexo.js +3 -0
  62. package/layout/_partial/scripts/import.ejs +0 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,36 @@
1
+ # Changelog
2
+
3
+ ## [5.2.0](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.1.1...v5.2.0) (2022-05-21)
4
+
5
+
6
+ ### Features
7
+
8
+ * **artalk:** Add support for using custom imgUploader ([b69c502](https://github.com/volantis-x/hexo-theme-volantis/commit/b69c502565d8b4d6d1ad1a58fdc3fc00ac200cef))
9
+
10
+ ### [5.1.1](https://github.com/volantis-x/hexo-theme-volantis/compare/v5.1.0...v5.1.1) (2022-05-19)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **#761:** overflow ([74e0d04](https://github.com/volantis-x/hexo-theme-volantis/commit/74e0d04a47d17c513f0d29ecaceb49b51d63ee18))
16
+
17
+ ## [5.1.0](https://github.com/volantis-x/hexo-theme-volantis/compare/5.0.0...v5.1.0) (2022-05-19)
18
+
19
+
20
+ ### Features
21
+
22
+ * release-please ([97efd35](https://github.com/volantis-x/hexo-theme-volantis/commit/97efd352d3f44d7f12a813db89c07ab0ba56e188))
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * 703 ([034d684](https://github.com/volantis-x/hexo-theme-volantis/commit/034d6847050472d7fe89335d65f371112c7449e8))
28
+ * 706 移动端菜单栏异常 ([e1f63b3](https://github.com/volantis-x/hexo-theme-volantis/commit/e1f63b33d47a992c278eb51471e5e2816ebc138f))
29
+ * 713 ([e1233de](https://github.com/volantis-x/hexo-theme-volantis/commit/e1233de457648ea46597a5ec4875efc5011e58b5))
30
+ * 740 ([a845788](https://github.com/volantis-x/hexo-theme-volantis/commit/a845788c9dbc1c251e93ca6e8b557d6e1bfb849e))
31
+ * Discuss 评论系统适配深色模式 ([#752](https://github.com/volantis-x/hexo-theme-volantis/issues/752)) ([86002b6](https://github.com/volantis-x/hexo-theme-volantis/commit/86002b67af0060e21e9ac2514aeee64377e01e69))
32
+ * error friendly ([3bffeab](https://github.com/volantis-x/hexo-theme-volantis/commit/3bffeabc2399cd3dda5816c13b1b56be25d7f95f))
33
+ * no-title ([48c70f8](https://github.com/volantis-x/hexo-theme-volantis/commit/48c70f8c13dd4d6dc7fa1bb5226c5987fde7971f))
34
+ * **twikoo:** 所有页面都说同一个path的bug ([14de40b](https://github.com/volantis-x/hexo-theme-volantis/commit/14de40bbe12e1e1679a60a58e0d501625d0e7ff2))
35
+ * 为 Discuss 添加最低高度 ([#742](https://github.com/volantis-x/hexo-theme-volantis/issues/742)) ([9bf70de](https://github.com/volantis-x/hexo-theme-volantis/commit/9bf70debfb8a38da89a7bf5f7bd7634d504aa457))
36
+ * 修复Discuss评论区表情包在深色模式下,css权重低的bug ([#753](https://github.com/volantis-x/hexo-theme-volantis/issues/753)) ([872baf7](https://github.com/volantis-x/hexo-theme-volantis/commit/872baf7481b1bb6e47381638c5c346fb232a398a))
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
 
@@ -10,7 +11,7 @@ Check your environment:
10
11
 
11
12
  ```yaml
12
13
  Hexo: 5.4 ~ 6.x
13
- hexo-cli: 4.x
14
+ hexo-cli: 4.3 ~ latest
14
15
  node.js: 16.x LTS ~ latest LTS
15
16
  npm: 8.x ~ latest LTS
16
17
  ```
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-rc.9' # 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 调试模式
@@ -13,9 +12,10 @@ default:
13
12
  cover: volantis-static/media/placeholder/cover/76b86c0226ffd.svg # https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/cover/76b86c0226ffd.svg
14
13
  image: volantis-static/media/placeholder/image/2659360.svg # https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/image/2659360.svg
15
14
  ############################### CSP ###############################
16
- # 内容安全策略( CSP )
15
+ # 内容安全策略( CSP ) meta 标签 http-equiv="Content-Security-Policy"
17
16
  # https://developer.mozilla.org/zh-CN/docs/Web/HTTP/CSP
18
17
  # https://content-security-policy.com/
18
+ # 也可以设为 false 在 HTTP 标头中设置 https://volantis.js.org/v5/advanced-settings/#设置-HTTP-响应标头
19
19
  csp:
20
20
  enable: true
21
21
  content: "
@@ -53,7 +53,9 @@ cdn:
53
53
  app: /js/app.js
54
54
  css:
55
55
  style: /css/style.css # (异步加载样式)
56
- # 请求静态资源添加版本号 本地文件使用文件内容的hash值作为版本号(app.8c1e7c88.js) 其他为时间戳 (?time=1648684470140)
56
+ # 静态资源版本控制
57
+ # 本地文件使用文件内容的hash值作为版本号(app.8c1e7c88.js) 其他为时间戳 (?time=1648684470140)
58
+ # 建议静态资源设置标头 浏览器缓存一年边缘缓存一个月 cache-control: max-age=86400, s-maxage=31536000 如果有更新记得刷新缓存
57
59
  cdn_version: true
58
60
  # volantis static 静态资源文件 npm 包 CDN 地址 (后面加 "/" )
59
61
  # https://github.com/volantis-x/volantis-static
@@ -62,12 +64,13 @@ volantis_static_cdn: https://unpkg.com/volantis-static@0.0.1649552113628/
62
64
  # 全局页面字符串替换 A => B (可用于临时修改错字等)
63
65
  replace:
64
66
  - https://cdn.jsdelivr.net/npm/ => https://unpkg.com/
65
- - https://unpkg.com/ => https://npm.elemecdn.com/
67
+ - https://cdn.jsdelivr.net/gh/ => https://fastly.jsdelivr.net/gh/
68
+ # - https://unpkg.com/ => https://npm.elemecdn.com/
66
69
 
67
70
  # dns-prefetch preconnect x-dns-prefetch-control
68
71
  dns_prefetch:
69
- # - https://unpkg.com
70
- - https://npm.elemecdn.com
72
+ - https://unpkg.com
73
+ # - https://npm.elemecdn.com
71
74
 
72
75
  # 平滑滚动效果
73
76
  scroll_smooth: true
@@ -276,20 +279,25 @@ comments:
276
279
  # https://artalk.js.org/
277
280
  # https://github.com/ArtalkJS/Artalk
278
281
  artalk:
279
- js: https://unpkg.com/artalk@2.1.3/dist/Artalk.js
280
- css: https://unpkg.com/artalk@2.1.3/dist/Artalk.css
281
- server: http://127.0.0.1:8080/api # 修改为自建的后端服务地址
282
+ js: https://yours-artalk-domain/dist/Artalk.js # or https://unpkg.com/artalk@2.2.8/dist/Artalk.js
283
+ css: https://yours-artalk-domain/dist/Artalk.css # or https://unpkg.com/artalk@2.2.8/dist/Artalk.css
284
+ server: https://yours-artalk-domain # 修改为自建的后端服务地址
282
285
  path: # 全局评论地址
283
- # 更多选项 https://artalk.js.org/guide/frontend/config.htm 按照yml格式继续填写即可
284
- # 除了 [el pageKey pageTitle site] 选项
285
- # 下面是一些例子:
286
- placeholder: 来啊,快活啊 ( ゜- ゜) # 全局评论占位
287
- noComment: 快来成为第一个评论的人吧~ # 评论为空时,评论列表显示字符
288
- pagination:
289
- readMore: true # 加载更多模式
290
- autoLoad: false # 滚动到底部自动加载
291
- pageSize: 10 # 每次请求获取数量
292
-
286
+ placeholder: # 评论占位
287
+ # artalk 有三类图片:1.上传至服务端 2.上传至服务端后利用upgit上传至图床 3.前端上传至图床(本配置为此类)
288
+ # 配置此项时将覆盖服务端上传能力
289
+ imgUploader:
290
+ # 以兰空图床为例,下列填写内容为:
291
+ # url: 'https://xxxxxx/api/v1/upload'
292
+ # token: 'Bearer xxxxxxxxxxxxxx'
293
+ # resp: 'data.links.url'
294
+ api: # 图床地址
295
+ token: # 图床验证
296
+ resp: # 图片地址返回值的字段
297
+ # 更多置项可在 Artalk 后端进行配置,详见 https://artalk.js.org/guide/backend/fe-control.html
298
+ # 也可以在此处继续参考上方例子进行配置,不建议重写配置的字段除上方所述外还有:
299
+ # [el, useBackendConf, pageKey, pageTitle, site, darkMode, pvEl, imgUploader]
300
+
293
301
  # giscus
294
302
  # https://giscus.app
295
303
  # https://github.com/laymonage/giscus
@@ -407,19 +415,31 @@ comments:
407
415
  # Waline
408
416
  # https://waline.js.org/
409
417
  waline:
410
- js: https://npm.elemecdn.com/@waline/client@1.6.0/dist/Waline.min.js
418
+ js: https://unpkg.com/@waline/client@v2/dist/waline.js
419
+ css: https://unpkg.com/@waline/client@v2/dist/waline.css
411
420
  path: # 全局评论地址 目前设置全局评论地址后visitor失效,这是waline的问题
412
- placeholder: 快来评论吧~ # 评论占位提示
413
- # imageHosting: https://7bu.top/api/upload?token=7ffe9d626fe4315c953758efbdb6ee2e # 图床api(默认注释使用base64)
414
- # 其他配置项按照yml格式继续填写即可 除了 [el path placeholder uploadImage] 选项
415
- meta: [nick,mail,link] # waline comment header info
416
- requiredFields: [nick,mail]
417
- serverURL: xxxxxxxxxxxxxxx # Waline 的服务端地址(必填) 测试用地址: https://waline-ruddy.vercel.app
418
- avatar: robohash # gravatar style https://waline.js.org/client/basic.html#avatar
419
- avatarCDN: #https://sdn.geekzu.org/avatar/
420
- pageSize: 10 # 评论每页显示数量
421
- lang: zh-CN
422
- visitor: true
421
+ placeholder: # 评论占位提示
422
+ serverURL: # Waline 的服务端地址(必填) 测试用地址: https://waline.vercel.app
423
+ imageUploader:
424
+ # 以兰空图床为例,下列填写内容为:
425
+ # url: https://xxxxxx/api/v1/upload
426
+ # token: Bearer xxxxxxxxxxxxxx
427
+ # resp: data.links.url
428
+ api: # 图床地址
429
+ token: # 图床验证
430
+ resp: # 图片地址返回值的字段
431
+ pageview: true # 浏览量统计
432
+ comment: true # 评论数统计
433
+ # 其他配置项按照yml格式继续填写即可 除了 [el path imageUploader] 选项
434
+ # 组件属性地址:https://waline.js.org/reference/component.html
435
+ # meta: ['nick', 'mail', 'link']
436
+
437
+ # Discuss
438
+ # https://discuss.js.org
439
+ discuss:
440
+ js: https://cdn.jsdelivr.net/npm/discuss/dist/Discuss.js # 建议锁定版本
441
+ serverURLs: # Discuss server address url
442
+ # https://discuss.js.org/Quick-Start.html#path
423
443
 
424
444
 
425
445
  ############################### Comments ############################### > end
@@ -525,7 +545,6 @@ sidebar:
525
545
  text: '本站总字数:' # 需要启用 wordcount
526
546
  unit: '字'
527
547
  visitcounter:
528
- service: leancloud # busuanzi, leancloud
529
548
  siteuv:
530
549
  enable: true
531
550
  text: '本站访客数:'
@@ -675,7 +694,7 @@ plugins:
675
694
 
676
695
  # https://scrollrevealjs.org/api/reveal.html
677
696
  scrollreveal:
678
- enable: #true
697
+ enable: true
679
698
  js: volantis-static/libs/scrollreveal/dist/scrollreveal.min.js # https://unpkg.com/scrollreveal@4.0.9/dist/scrollreveal.min.js
680
699
  distance: 32px
681
700
  duration: 800 # ms
@@ -862,9 +881,9 @@ plugins:
862
881
  enable: true
863
882
  play: fa-solid fa-play
864
883
  pause: fa-solid fa-pause
865
- rightmenu:
884
+ rightmenu:
866
885
  enable: true # 是否开启右键模块的消息通知
867
- notice: true # 唤醒原右键菜单的通知
886
+ notice: true # 唤醒原右键菜单的通知
868
887
 
869
888
  # 聊天功能
870
889
  chat_service: # tidio or gitter
@@ -878,7 +897,7 @@ plugins:
878
897
  # https://gitter.im
879
898
  gitter:
880
899
  room: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
881
-
900
+
882
901
  # swiper
883
902
  # https://www.swiper.com.cn/
884
903
  swiper:
@@ -895,12 +914,13 @@ rightmenus:
895
914
  enable: true
896
915
  # 右键菜单项及加载顺序
897
916
  # 内容示例:plugins.[组名], menus.[组名], hr(分割线,推荐去线留白), music(音乐控制器)
898
- order:
917
+ order:
899
918
  - plugins.navigation
900
919
  - hr
901
920
  - plugins.inputBox
902
921
  - plugins.seletctText
903
922
  - plugins.elementCheck
923
+ - plugins.elementImage
904
924
  - menus.link
905
925
  - hr
906
926
  - menus.darkMode
@@ -917,7 +937,7 @@ rightmenus:
917
937
  # 注:
918
938
  # 1. link/event 二选一,同时出现时仅处理 link
919
939
  # 2. 内置事件列表: copyText, copyLink, copyPaste, copyAll, copyCut, copyImg, printMode, readMode
920
- # 3. 内置组列表:navigation, inputBox, seletctText, elementCheck, articlePage
940
+ # 3. 内置组列表:navigation, inputBox, seletctText, elementCheck, elementImage, articlePage
921
941
  # 4. plugins 列允许自定义组内项目
922
942
  # 5. menus 列允许自定义组及其内容
923
943
  # 6. 除 navigation 外的内置组,在显示时会隐藏含 link 属性的菜单项
@@ -929,12 +949,12 @@ rightmenus:
929
949
  # 例外,在 articlePage 组显示时(文章页)时依旧显示含 link 属性的菜单项
930
950
  articleShowLink: false
931
951
  # 当设定全局音乐播放器时,是否一直显示音乐控制菜单。false:仅当音乐播放时启用
932
- musicAlwaysShow: true
952
+ musicAlwaysShow: false
933
953
  # 右键内置组,预置实现
934
954
  plugins:
935
955
  # 导航组件
936
956
  # 横向排列,共用一行,仅显示图标 (原则上支持的数量不限)
937
- navigation:
957
+ navigation:
938
958
  - {id: 'left', name: '转到上一页', icon: 'fa-solid fa-arrow-left', event: 'history.back()', group: 'navigation'}
939
959
  - {id: 'right', name: '转到下一页', icon: 'fa-solid fa-arrow-right', event: 'history.forward()', group: 'navigation'}
940
960
  - {id: 'redo', name: '刷新当前页面', icon: 'fa-solid fa-redo', event: 'window.location.reload()', group: 'navigation'}
@@ -947,19 +967,22 @@ rightmenus:
947
967
  - {id: 'copyAll', name: '全选文本', icon: 'fa-solid fa-object-ungroup', event: 'copyAll', group: 'inputBox'}
948
968
  - {id: 'copyCut', name: '剪切文本', icon: 'fa-solid fa-cut', event: 'copyCut', group: 'inputBox'}
949
969
  # 文本选中类组件
950
- # 生效于右键选中文本,__text__ 为选中的文本。
970
+ # 生效于右键选中文本,__text__ 为选中的文本。
951
971
  seletctText:
952
972
  - {id: 'copyText', name: '复制文本', icon: 'fa-solid fa-copy', event: 'copyText', group: 'seletctText'}
953
973
  - {id: 'searchWord', name: '站内搜索', icon: 'fa-solid fa-search', event: 'OpenSearch(__text__)', group: 'seletctText'}
954
974
  - {id: 'bingSearch', name: '必应搜索', icon: 'fa-solid fa-search', event: 'window.open(`https://cn.bing.com/search?q=${__text__}`)', group: 'seletctText'}
955
975
  #- {id: 'googleSearch', name: '谷歌搜索', icon: 'fa-solid fa-search', event: 'window.open(`https://www.google.com/search?q=${__text__}`)', group: 'seletctText'}
956
- # 元素判断组件
957
- # 生效于 a/img 处的右键行为,__link__ 为链接地址
976
+ # 链接判断组件
977
+ # 生效于链接处的右键行为,__link__ 为链接地址
958
978
  elementCheck:
959
979
  - {id: 'openTab', name: '新标签页打开', icon: 'fa-solid fa-external-link-square-alt', event: 'window.open(__link__)', group: 'elementCheck'}
960
980
  - {id: 'copyLink', name: '复制链接地址', icon: 'fa-solid fa-link', event: 'copyLink', group: 'elementCheck'}
961
- # 复制图片文件至剪切板,仅支持 png 格式
962
- - {id: 'copyImg', name: '复制图片文件', icon: 'fa-solid fa-image', event: 'copyImg', group: 'elementCheck'}
981
+ # 图片判断类组件
982
+ # 生效于图片类的右键行为,__link__ 为链接地址
983
+ elementImage:
984
+ - {id: 'copyImg', name: '复制图片', icon: 'fa-solid fa-image', event: 'copyImg', group: 'elementImage'}
985
+ - {id: 'googleImg', name: '谷歌识图', icon: 'fa-solid fa-images', event: 'window.open(`https://www.google.com.hk/searchbyimage?image_url=${__link__}`)', group: 'elementImage'}
963
986
  # 文章页面组件
964
987
  # 生效于 post.article 页面
965
988
  articlePage:
@@ -974,7 +997,7 @@ rightmenus:
974
997
  - hr
975
998
  - {id: 'source_docs', name: '本站源码', icon: 'fa-solid fa-code-branch', link: 'https://github.com/volantis-x/volantis-docs/', group: 'link'}
976
999
  - {id: 'source_theme', name: '主题源码', icon: 'fa-solid fa-code-branch', link: 'https://github.com/volantis-x/hexo-theme-volantis/', group: 'link'}
977
- darkMode:
1000
+ darkMode:
978
1001
  - {id: 'darkMode', name: '暗黑模式', icon: 'fa-solid fa-moon', event: 'volantis.dark.toggle()', group: 'darkMode'}
979
1002
  ###
980
1003
 
@@ -26,7 +26,7 @@
26
26
  </p>
27
27
  </a>
28
28
  </div>
29
- -<% } else if (theme.comments.service=='waline' && theme.comments.waline.visitor) { %>
29
+ <% } else if (theme.comments.service=='waline' && theme.comments.waline.pageview) { %>
30
30
  <div class="new-meta-item browse">
31
31
  <a class='notlink'>
32
32
  <i class="<%- theme.article.body.meta_library.counter.icon %> fa-fw" aria-hidden="true"></i>
@@ -36,21 +36,43 @@
36
36
  path = path.substring(0, path.length - 10);
37
37
  }
38
38
  %>
39
- <span id="<%- url_for(path) %>" class="leancloud_visitors" data-flag-title="<%- post.title || page.title %>">
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>
40
46
  <p>
41
- <span class="leancloud-visitors-count"></span>
47
+ <span id="twikoo_visitors">
48
+ <i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i>
49
+ </span>
42
50
  </p>
43
51
  </span>
44
52
  </a>
45
53
  </div>
46
- <% } else if (theme.comments.service=='twikoo' && !!page.comments) { %>
54
+ <% } else if (theme.comments.service=='discuss' && !!page.comments) { %>
47
55
  <div class="new-meta-item browse">
48
56
  <a class='notlink'>
49
57
  <i class="<%- theme.article.body.meta_library.counter.icon %> fa-fw" aria-hidden="true"></i>
50
58
  <p>
51
- <span id="twikoo_visitors"></span>
59
+ <span id="Discuss-Visitors">
60
+ <i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i>
61
+ </span>
52
62
  </p>
53
63
  </span>
54
64
  </a>
55
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>
56
78
  <% } %>
@@ -5,10 +5,11 @@
5
5
  if (path.length > 9 && (path.substring(path.length - 10) == 'index.html')) {
6
6
  path = path.substring(0, path.length - 10);
7
7
  }
8
+ if(!!theme.comments.waline.path) path = theme.comments.waline.path
8
9
  %>
9
10
  <a href="<%- url_for(path) %>#comments">
10
11
  <i class="<%- theme.article.body.meta_library.walinecount.icon %> fa-fw"></i>
11
- <span id="<%- url_for(path) %>" class="waline-comment-count"></span>
12
+ <span data-path="<%- url_for(path) %>" class="waline-comment-count"></span>
12
13
  <span class="leancloud-comments-count">&nbsp;<%- theme.article.body.meta_library.walinecount.desc %></span>
13
14
  </a>
14
15
  </div>
@@ -114,13 +114,13 @@
114
114
  <div class="prev-next">
115
115
  <% if (post.prev) { %>
116
116
  <a class='prev' href='<%- url_for(post.prev.path) %>'>
117
- <p class='title'><i class="fa-solid fa-chevron-left" aria-hidden="true"></i><%- post.prev.title || post.prev.seo_title || '' %></p>
117
+ <p class='title'><i class="fa-solid fa-chevron-left" aria-hidden="true"></i><%- post.prev.title || post.prev.seo_title || date(post.date, theme.article.body.meta_library.date.format) %></p>
118
118
  <p class='content'><%- truncate(strip_html(page.prev.content), {length: 100}) %></p>
119
119
  </a>
120
120
  <% } %>
121
121
  <% if (post.next) { %>
122
122
  <a class='next' href='<%- url_for(post.next.path) %>'>
123
- <p class='title'><%- post.next.title || post.next.seo_title || '' %><i class="fa-solid fa-chevron-right" aria-hidden="true"></i></p>
123
+ <p class='title'><%- post.next.title || post.next.seo_title || date(post.date, theme.article.body.meta_library.date.format) %><i class="fa-solid fa-chevron-right" aria-hidden="true"></i></p>
124
124
  <p class='content'><%- truncate(strip_html(page.next.content), {length: 100}) %></p>
125
125
  </a>
126
126
  <% } %>
@@ -1,5 +1,6 @@
1
1
  <head hexo-theme='https://github.com/volantis-x/hexo-theme-volantis/tree/<%- theme.info.theme_version %>'>
2
2
  <%- meta_generator() %>
3
+ <meta name="Volantis" content="<%- theme.info.theme_version %>">
3
4
  <meta charset="utf-8">
4
5
  <!-- SEO相关 -->
5
6
  <%- generate_seo(theme, page) %>
@@ -21,19 +22,23 @@
21
22
  <meta name="HandheldFriendly" content="True" >
22
23
  <meta name="apple-mobile-web-app-capable" content="yes">
23
24
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
24
- <meta content="<%=config.title%>" name="application-name">
25
- <meta content="<%=config.title%>" name="apple-mobile-web-app-title">
26
25
  <meta content="black-translucent" name="apple-mobile-web-app-status-bar-style">
27
26
  <meta content="telephone=no" name="format-detection">
27
+ <!-- import head_begin begin -->
28
+ <%_ if (config.import && config.import.head_begin){ _%>
29
+ <%_ ([...config.import.head_begin]).forEach(function(item){ _%>
30
+ <%- item %>
31
+ <%_ }) _%>
32
+ <%_ } _%>
33
+ <!-- import head_begin end -->
34
+ <!-- Custom Files headBegin begin-->
35
+ <%- volantis_inject('headBegin') %>
36
+ <!-- Custom Files headBegin end-->
37
+ <%_ if (config.favicon) { _%>
38
+ <link rel="shortcut icon" type='image/x-icon' href="<%- url_for(config.favicon) %>">
39
+ <%_ } _%>
28
40
  <link rel="preload" href="<%- theme.cdn.map.css.style %>" as="style">
29
41
  <%- generate_preload_fontfamily(theme) %>
30
- <!-- 页面元数据 -->
31
- <pjax>
32
- <%- generate_title(config, theme, page) %>
33
- <%- generate_keywords(config, theme, page) %>
34
- <%- generate_description(config, theme, page) %>
35
- <%- open_graph(theme.open_graph) %>
36
- </pjax>
37
42
  <!-- feed -->
38
43
  <%_ if (config.feed && config.feed.path){ _%>
39
44
  <%_ if (typeof(config.feed.path)=="string"){ _%>
@@ -44,22 +49,11 @@
44
49
  <%_ }) _%>
45
50
  <%_ } _%>
46
51
  <%_ } _%>
47
- <!-- import meta -->
48
- <%_ if (config.import && config.import.meta){ _%>
49
- <%_ (config.import.meta||[]).forEach(function(item){ _%>
50
- <%- item %>
51
- <%_ }) _%>
52
- <%_ } _%>
53
- <!-- link -->
54
- <%_ if (config.favicon) { _%>
55
- <link rel="shortcut icon" type='image/x-icon' href="<%- url_for(config.favicon) %>">
56
- <%_ } _%>
57
- <!-- import link -->
58
- <%_ if (config.import && config.import.link){ _%>
59
- <%_ (config.import.link||[]).forEach(function(item){ _%>
60
- <%- item %>
61
- <%_ }) _%>
62
- <%_ } _%>
52
+ <!-- 页面元数据 -->
53
+ <%- generate_title(config, theme, page) %>
54
+ <%- generate_keywords(config, theme, page) %>
55
+ <%- generate_description(config, theme, page) %>
56
+ <%- open_graph(theme.open_graph) %>
63
57
  <style>
64
58
  /* 首屏样式 */
65
59
  <%- FirstCSS() %>
@@ -76,7 +70,14 @@
76
70
  <%_ } _%>
77
71
  <%- partial('../_plugins/end-of-support/script') %>
78
72
  <%- partial('scripts/global') %>
79
- <!-- Custom Files head begin-->
80
- <%- volantis_inject('head') %>
81
- <!-- Custom Files head end-->
73
+ <!-- import head_end begin -->
74
+ <%_ if (config.import && config.import.head_end){ _%>
75
+ <%_ ([...config.import.head_end]).forEach(function(item){ _%>
76
+ <%- item %>
77
+ <%_ }) _%>
78
+ <%_ } _%>
79
+ <!-- import head_end end -->
80
+ <!-- Custom Files headEnd begin-->
81
+ <%- volantis_inject('headEnd') %>
82
+ <!-- Custom Files headEnd end-->
82
83
  </head>
@@ -61,7 +61,7 @@
61
61
  </li>
62
62
  <% } else { %>
63
63
  <li>
64
- <a class="menuitem flat-box faa-parent animated-hover"
64
+ <a class="menuitem flat-box faa-parent animated-hover"
65
65
  <%- value.url ? `href="` + url_for(value.url) + `" title="` + (value.description || value.name) + `"`
66
66
  : ` href="/" onclick="return false;" title="` + (value.description || value.name) + `"` %>
67
67
  <% if (value.rel) { %>
@@ -1,86 +1,88 @@
1
1
  <script>
2
- // https://web.dev/content-visibility/
3
- // https://www.caniuse.com/?search=content-visibility
4
- // https://infrequently.org/2020/12/content-visibility-scroll-fix/
5
- // https://infrequently.org/2020/12/resize-resilient-deferred-rendering/
2
+ try {
3
+ // https://web.dev/content-visibility/
4
+ // https://www.caniuse.com/?search=content-visibility
5
+ // https://infrequently.org/2020/12/content-visibility-scroll-fix/
6
+ // https://infrequently.org/2020/12/resize-resilient-deferred-rendering/
6
7
 
7
- // 备注 目前已知的问题:
8
- // 动态修改导致的内容高度变化(例如评论框异步渲染的外部盒子高度变化) 无法提前获知, 进而导致的首次滚动条跳动无法去除 (wontfix) 事实上不使用 content-visibility 也会有跳动, 不过是比使用 content-visibility 跳动提前
9
- // scrollreveal 插件潜在问题 目前尚不明确
8
+ // 备注 目前已知的问题:
9
+ // 动态修改导致的内容高度变化(例如评论框异步渲染的外部盒子高度变化) 无法提前获知, 进而导致的首次滚动条跳动无法去除 (wontfix) 事实上不使用 content-visibility 也会有跳动, 不过是比使用 content-visibility 跳动提前
10
+ // scrollreveal 插件潜在问题 目前尚不明确
10
11
 
11
- let eqIsh = (a, b, fuzz = 2) => {
12
- return Math.abs(a - b) <= fuzz;
13
- };
12
+ let eqIsh = (a, b, fuzz = 2) => {
13
+ return Math.abs(a - b) <= fuzz;
14
+ };
14
15
 
15
- let rectNotEQ = (a, b) => {
16
- return !eqIsh(a.width, b.width) || !eqIsh(a.height, b.height);
17
- };
16
+ let rectNotEQ = (a, b) => {
17
+ return !eqIsh(a.width, b.width) || !eqIsh(a.height, b.height);
18
+ };
18
19
 
19
- // Keep a map of elements and the dimensions of
20
- // their place-holders, re-setting the element's
21
- // intrinsic size when we get updated measurements
22
- // from observers.
23
- let spaced = new WeakMap();
20
+ // Keep a map of elements and the dimensions of
21
+ // their place-holders, re-setting the element's
22
+ // intrinsic size when we get updated measurements
23
+ // from observers.
24
+ let spaced = new WeakMap();
24
25
 
25
- // Only call this when known cheap, post layout
26
- let reserveSpace = (el, rect = el.getClientBoundingRect()) => {
27
- let old = spaced.get(el);
28
- // Set intrinsic size to prevent jumping on un-painting:
29
- // https://drafts.csswg.org/css-sizing-4/#intrinsic-size-override
30
- if (!old || rectNotEQ(old, rect)) {
31
- spaced.set(el, rect);
32
- el.style["contain-intrinsic-size"] = `${rect.width}px ${rect.height}px`;
33
- }
34
- };
26
+ // Only call this when known cheap, post layout
27
+ let reserveSpace = (el, rect = el.getClientBoundingRect()) => {
28
+ let old = spaced.get(el);
29
+ // Set intrinsic size to prevent jumping on un-painting:
30
+ // https://drafts.csswg.org/css-sizing-4/#intrinsic-size-override
31
+ if (!old || rectNotEQ(old, rect)) {
32
+ spaced.set(el, rect);
33
+ el.style["contain-intrinsic-size"] = `${rect.width}px ${rect.height}px`;
34
+ }
35
+ };
35
36
 
36
- let iObs = new IntersectionObserver(
37
- (entries, o) => {
37
+ let iObs = new IntersectionObserver(
38
+ (entries, o) => {
39
+ entries.forEach((entry) => {
40
+ // We don't care if the element is intersecting or
41
+ // has been laid out as our page structure ensures
42
+ // they'll get the right width.
43
+ reserveSpace(entry.target, entry.boundingClientRect);
44
+ });
45
+ },
46
+ { rootMargin: "500px 0px 500px 0px" }
47
+ );
48
+
49
+ let rObs = new ResizeObserver((entries, o) => {
38
50
  entries.forEach((entry) => {
39
- // We don't care if the element is intersecting or
40
- // has been laid out as our page structure ensures
41
- // they'll get the right width.
42
- reserveSpace(entry.target, entry.boundingClientRect);
51
+ reserveSpace(entry.target, entry.contentRect);
43
52
  });
44
- },
45
- { rootMargin: "500px 0px 500px 0px" }
46
- );
47
-
48
- let rObs = new ResizeObserver((entries, o) => {
49
- entries.forEach((entry) => {
50
- reserveSpace(entry.target, entry.contentRect);
51
53
  });
52
- });
53
54
 
54
- let resizeResilientDeferredRendering = (Selector) => {
55
- let articles = document.querySelectorAll(Selector);
55
+ let resizeResilientDeferredRendering = (Selector) => {
56
+ let articles = document.querySelectorAll(Selector);
56
57
 
57
- if (articles.length) {
58
- articles.forEach((el) => {
59
- iObs.observe(el);
60
- rObs.observe(el);
61
- });
58
+ if (articles.length) {
59
+ articles.forEach((el) => {
60
+ iObs.observe(el);
61
+ rObs.observe(el);
62
+ });
62
63
 
63
- // Workaround for Chrome bug, part 2.
64
- //
65
- // Re-enable browser management of rendering for the
66
- // first article after the first paint. Double-rAF
67
- // to ensure we get called after a layout.
68
- requestAnimationFrame(() => {
64
+ // Workaround for Chrome bug, part 2.
65
+ //
66
+ // Re-enable browser management of rendering for the
67
+ // first article after the first paint. Double-rAF
68
+ // to ensure we get called after a layout.
69
69
  requestAnimationFrame(() => {
70
- articles[0].style["content-visibility"] = "auto";
70
+ requestAnimationFrame(() => {
71
+ articles[0].style["content-visibility"] = "auto";
72
+ });
71
73
  });
72
- });
73
- }
74
- };
74
+ }
75
+ };
75
76
 
76
- let contentVisibilityScrollFix = () => {
77
- if (!("content-visibility" in document.documentElement.style)) {
78
- return;
79
- }
80
- resizeResilientDeferredRendering(".post-story");
81
- resizeResilientDeferredRendering("article");
82
- resizeResilientDeferredRendering(".post-wrapper");
83
- };
84
- contentVisibilityScrollFix();
85
- volantis.pjax.push(contentVisibilityScrollFix);
77
+ let contentVisibilityScrollFix = () => {
78
+ if (!("content-visibility" in document.documentElement.style)) {
79
+ return;
80
+ }
81
+ resizeResilientDeferredRendering(".post-story");
82
+ };
83
+ contentVisibilityScrollFix();
84
+ volantis.pjax.push(contentVisibilityScrollFix);
85
+ } catch (error) {
86
+ console.log(error);
87
+ }
86
88
  </script>