hexo-theme-volantis 5.0.0-rc.9 → 5.1.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 (61) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +1 -1
  3. package/_config.yml +60 -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 +17 -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/render-stylus.js +1 -1
  37. package/scripts/filters/content-visibility.js +2 -2
  38. package/scripts/helpers/custom-files.js +3 -1
  39. package/scripts/helpers/head/generate_seo.js +1 -1
  40. package/scripts/helpers/structured-data/lib/blogposting.js +18 -6
  41. package/scripts/helpers/structured-data/lib/breadcrumblist.js +25 -1
  42. package/scripts/helpers/structured-data/lib/index.js +1 -9
  43. package/scripts/tags/fancybox.js +1 -1
  44. package/scripts/tags/tabs.js +85 -86
  45. package/source/css/_defines/AutoPrefixCSS.styl +16 -16
  46. package/source/css/_first/base_first.styl +4 -0
  47. package/source/css/_first/navbar_first.styl +1 -1
  48. package/source/css/_style/_base/base.styl +2 -2
  49. package/source/css/_style/_layout/toc.styl +2 -2
  50. package/source/css/_style/_plugins/_dark/dark_async.styl +1 -1
  51. package/source/css/_style/_plugins/_dark/dark_plugins.styl +8 -4
  52. package/source/css/_style/_plugins/_rightmenu/reading.styl +2 -2
  53. package/source/css/_style/_plugins/_rightmenu/rightmenu.styl +1 -1
  54. package/source/css/_style/_plugins/fontcolor.styl +1 -1
  55. package/source/css/first.styl +5 -7
  56. package/source/js/app.js +32 -35
  57. package/source/js/plugins/aplayer.js +1 -3
  58. package/source/js/plugins/rightMenu.js +22 -22
  59. package/source/js/plugins/rightMenus.js +115 -78
  60. package/source/js/search/hexo.js +3 -0
  61. package/layout/_partial/scripts/import.ejs +0 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ ## [5.1.0](https://github.com/volantis-x/hexo-theme-volantis/compare/5.0.0...v5.1.0) (2022-05-19)
4
+
5
+
6
+ ### Features
7
+
8
+ * release-please ([97efd35](https://github.com/volantis-x/hexo-theme-volantis/commit/97efd352d3f44d7f12a813db89c07ab0ba56e188))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * 703 ([034d684](https://github.com/volantis-x/hexo-theme-volantis/commit/034d6847050472d7fe89335d65f371112c7449e8))
14
+ * 706 移动端菜单栏异常 ([e1f63b3](https://github.com/volantis-x/hexo-theme-volantis/commit/e1f63b33d47a992c278eb51471e5e2816ebc138f))
15
+ * 713 ([e1233de](https://github.com/volantis-x/hexo-theme-volantis/commit/e1233de457648ea46597a5ec4875efc5011e58b5))
16
+ * 740 ([a845788](https://github.com/volantis-x/hexo-theme-volantis/commit/a845788c9dbc1c251e93ca6e8b557d6e1bfb849e))
17
+ * Discuss 评论系统适配深色模式 ([#752](https://github.com/volantis-x/hexo-theme-volantis/issues/752)) ([86002b6](https://github.com/volantis-x/hexo-theme-volantis/commit/86002b67af0060e21e9ac2514aeee64377e01e69))
18
+ * error friendly ([3bffeab](https://github.com/volantis-x/hexo-theme-volantis/commit/3bffeabc2399cd3dda5816c13b1b56be25d7f95f))
19
+ * no-title ([48c70f8](https://github.com/volantis-x/hexo-theme-volantis/commit/48c70f8c13dd4d6dc7fa1bb5226c5987fde7971f))
20
+ * **twikoo:** 所有页面都说同一个path的bug ([14de40b](https://github.com/volantis-x/hexo-theme-volantis/commit/14de40bbe12e1e1679a60a58e0d501625d0e7ff2))
21
+ * 为 Discuss 添加最低高度 ([#742](https://github.com/volantis-x/hexo-theme-volantis/issues/742)) ([9bf70de](https://github.com/volantis-x/hexo-theme-volantis/commit/9bf70debfb8a38da89a7bf5f7bd7634d504aa457))
22
+ * 修复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
@@ -10,7 +10,7 @@ Check your environment:
10
10
 
11
11
  ```yaml
12
12
  Hexo: 5.4 ~ 6.x
13
- hexo-cli: 4.x
13
+ hexo-cli: 4.3 ~ latest
14
14
  node.js: 16.x LTS ~ latest LTS
15
15
  npm: 8.x ~ latest LTS
16
16
  ```
package/_config.yml CHANGED
@@ -1,7 +1,7 @@
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.
4
+ theme_version: '5.0.0-alpha.112' # This is theme's version.
5
5
  theme_docs: https://volantis.js.org/ # This is theme's URL.
6
6
  theme_repo: https://github.com/volantis-x/hexo-theme-volantis
7
7
  # Debug 调试模式
@@ -13,9 +13,10 @@ default:
13
13
  cover: volantis-static/media/placeholder/cover/76b86c0226ffd.svg # https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/cover/76b86c0226ffd.svg
14
14
  image: volantis-static/media/placeholder/image/2659360.svg # https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/image/2659360.svg
15
15
  ############################### CSP ###############################
16
- # 内容安全策略( CSP )
16
+ # 内容安全策略( CSP ) meta 标签 http-equiv="Content-Security-Policy"
17
17
  # https://developer.mozilla.org/zh-CN/docs/Web/HTTP/CSP
18
18
  # https://content-security-policy.com/
19
+ # 也可以设为 false 在 HTTP 标头中设置 https://volantis.js.org/v5/advanced-settings/#设置-HTTP-响应标头
19
20
  csp:
20
21
  enable: true
21
22
  content: "
@@ -53,7 +54,9 @@ cdn:
53
54
  app: /js/app.js
54
55
  css:
55
56
  style: /css/style.css # (异步加载样式)
56
- # 请求静态资源添加版本号 本地文件使用文件内容的hash值作为版本号(app.8c1e7c88.js) 其他为时间戳 (?time=1648684470140)
57
+ # 静态资源版本控制
58
+ # 本地文件使用文件内容的hash值作为版本号(app.8c1e7c88.js) 其他为时间戳 (?time=1648684470140)
59
+ # 建议静态资源设置标头 浏览器缓存一年边缘缓存一个月 cache-control: max-age=86400, s-maxage=31536000 如果有更新记得刷新缓存
57
60
  cdn_version: true
58
61
  # volantis static 静态资源文件 npm 包 CDN 地址 (后面加 "/" )
59
62
  # https://github.com/volantis-x/volantis-static
@@ -62,12 +65,13 @@ volantis_static_cdn: https://unpkg.com/volantis-static@0.0.1649552113628/
62
65
  # 全局页面字符串替换 A => B (可用于临时修改错字等)
63
66
  replace:
64
67
  - https://cdn.jsdelivr.net/npm/ => https://unpkg.com/
65
- - https://unpkg.com/ => https://npm.elemecdn.com/
68
+ - https://cdn.jsdelivr.net/gh/ => https://fastly.jsdelivr.net/gh/
69
+ # - https://unpkg.com/ => https://npm.elemecdn.com/
66
70
 
67
71
  # dns-prefetch preconnect x-dns-prefetch-control
68
72
  dns_prefetch:
69
- # - https://unpkg.com
70
- - https://npm.elemecdn.com
73
+ - https://unpkg.com
74
+ # - https://npm.elemecdn.com
71
75
 
72
76
  # 平滑滚动效果
73
77
  scroll_smooth: true
@@ -276,20 +280,15 @@ comments:
276
280
  # https://artalk.js.org/
277
281
  # https://github.com/ArtalkJS/Artalk
278
282
  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 # 修改为自建的后端服务地址
283
+ js: https://yours-artalk-domain/dist/Artalk.js # or https://unpkg.com/artalk@2.2.8/dist/Artalk.js
284
+ css: https://yours-artalk-domain/dist/Artalk.css # or https://unpkg.com/artalk@2.2.8/dist/Artalk.css
285
+ server: https://yours-artalk-domain # 修改为自建的后端服务地址
282
286
  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
-
287
+ placeholder: # 评论占位
288
+ # 更多置项可在 Artalk 后端进行配置,详见 https://artalk.js.org/guide/backend/fe-control.html
289
+ # 也可以在此处继续参考上方例子进行配置,不建议重写配置的字段除上方所述外还有:
290
+ # [el, useBackendConf, pageKey, pageTitle, site, darkMode, pvEl]
291
+
293
292
  # giscus
294
293
  # https://giscus.app
295
294
  # https://github.com/laymonage/giscus
@@ -407,19 +406,31 @@ comments:
407
406
  # Waline
408
407
  # https://waline.js.org/
409
408
  waline:
410
- js: https://npm.elemecdn.com/@waline/client@1.6.0/dist/Waline.min.js
409
+ js: https://unpkg.com/@waline/client@v2/dist/waline.js
410
+ css: https://unpkg.com/@waline/client@v2/dist/waline.css
411
411
  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
412
+ placeholder: # 评论占位提示
413
+ serverURL: # Waline 的服务端地址(必填) 测试用地址: https://waline.vercel.app
414
+ imageUploader:
415
+ # 以兰空图床为例,下列填写内容为:
416
+ # url: https://xxxxxx/api/v1/upload
417
+ # token: Bearer xxxxxxxxxxxxxx
418
+ # resp: data.links.url
419
+ api: # 图床地址
420
+ token: # 图床验证
421
+ resp: # 图片地址返回值的字段
422
+ pageview: true # 浏览量统计
423
+ comment: true # 评论数统计
424
+ # 其他配置项按照yml格式继续填写即可 除了 [el path imageUploader] 选项
425
+ # 组件属性地址:https://waline.js.org/reference/component.html
426
+ # meta: ['nick', 'mail', 'link']
427
+
428
+ # Discuss
429
+ # https://discuss.js.org
430
+ discuss:
431
+ js: https://cdn.jsdelivr.net/npm/discuss/dist/Discuss.js # 建议锁定版本
432
+ serverURLs: # Discuss server address url
433
+ # https://discuss.js.org/Quick-Start.html#path
423
434
 
424
435
 
425
436
  ############################### Comments ############################### > end
@@ -525,7 +536,6 @@ sidebar:
525
536
  text: '本站总字数:' # 需要启用 wordcount
526
537
  unit: '字'
527
538
  visitcounter:
528
- service: leancloud # busuanzi, leancloud
529
539
  siteuv:
530
540
  enable: true
531
541
  text: '本站访客数:'
@@ -675,7 +685,7 @@ plugins:
675
685
 
676
686
  # https://scrollrevealjs.org/api/reveal.html
677
687
  scrollreveal:
678
- enable: #true
688
+ enable: true
679
689
  js: volantis-static/libs/scrollreveal/dist/scrollreveal.min.js # https://unpkg.com/scrollreveal@4.0.9/dist/scrollreveal.min.js
680
690
  distance: 32px
681
691
  duration: 800 # ms
@@ -862,9 +872,9 @@ plugins:
862
872
  enable: true
863
873
  play: fa-solid fa-play
864
874
  pause: fa-solid fa-pause
865
- rightmenu:
875
+ rightmenu:
866
876
  enable: true # 是否开启右键模块的消息通知
867
- notice: true # 唤醒原右键菜单的通知
877
+ notice: true # 唤醒原右键菜单的通知
868
878
 
869
879
  # 聊天功能
870
880
  chat_service: # tidio or gitter
@@ -878,7 +888,7 @@ plugins:
878
888
  # https://gitter.im
879
889
  gitter:
880
890
  room: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
881
-
891
+
882
892
  # swiper
883
893
  # https://www.swiper.com.cn/
884
894
  swiper:
@@ -895,12 +905,13 @@ rightmenus:
895
905
  enable: true
896
906
  # 右键菜单项及加载顺序
897
907
  # 内容示例:plugins.[组名], menus.[组名], hr(分割线,推荐去线留白), music(音乐控制器)
898
- order:
908
+ order:
899
909
  - plugins.navigation
900
910
  - hr
901
911
  - plugins.inputBox
902
912
  - plugins.seletctText
903
913
  - plugins.elementCheck
914
+ - plugins.elementImage
904
915
  - menus.link
905
916
  - hr
906
917
  - menus.darkMode
@@ -917,7 +928,7 @@ rightmenus:
917
928
  # 注:
918
929
  # 1. link/event 二选一,同时出现时仅处理 link
919
930
  # 2. 内置事件列表: copyText, copyLink, copyPaste, copyAll, copyCut, copyImg, printMode, readMode
920
- # 3. 内置组列表:navigation, inputBox, seletctText, elementCheck, articlePage
931
+ # 3. 内置组列表:navigation, inputBox, seletctText, elementCheck, elementImage, articlePage
921
932
  # 4. plugins 列允许自定义组内项目
922
933
  # 5. menus 列允许自定义组及其内容
923
934
  # 6. 除 navigation 外的内置组,在显示时会隐藏含 link 属性的菜单项
@@ -929,12 +940,12 @@ rightmenus:
929
940
  # 例外,在 articlePage 组显示时(文章页)时依旧显示含 link 属性的菜单项
930
941
  articleShowLink: false
931
942
  # 当设定全局音乐播放器时,是否一直显示音乐控制菜单。false:仅当音乐播放时启用
932
- musicAlwaysShow: true
943
+ musicAlwaysShow: false
933
944
  # 右键内置组,预置实现
934
945
  plugins:
935
946
  # 导航组件
936
947
  # 横向排列,共用一行,仅显示图标 (原则上支持的数量不限)
937
- navigation:
948
+ navigation:
938
949
  - {id: 'left', name: '转到上一页', icon: 'fa-solid fa-arrow-left', event: 'history.back()', group: 'navigation'}
939
950
  - {id: 'right', name: '转到下一页', icon: 'fa-solid fa-arrow-right', event: 'history.forward()', group: 'navigation'}
940
951
  - {id: 'redo', name: '刷新当前页面', icon: 'fa-solid fa-redo', event: 'window.location.reload()', group: 'navigation'}
@@ -947,19 +958,22 @@ rightmenus:
947
958
  - {id: 'copyAll', name: '全选文本', icon: 'fa-solid fa-object-ungroup', event: 'copyAll', group: 'inputBox'}
948
959
  - {id: 'copyCut', name: '剪切文本', icon: 'fa-solid fa-cut', event: 'copyCut', group: 'inputBox'}
949
960
  # 文本选中类组件
950
- # 生效于右键选中文本,__text__ 为选中的文本。
961
+ # 生效于右键选中文本,__text__ 为选中的文本。
951
962
  seletctText:
952
963
  - {id: 'copyText', name: '复制文本', icon: 'fa-solid fa-copy', event: 'copyText', group: 'seletctText'}
953
964
  - {id: 'searchWord', name: '站内搜索', icon: 'fa-solid fa-search', event: 'OpenSearch(__text__)', group: 'seletctText'}
954
965
  - {id: 'bingSearch', name: '必应搜索', icon: 'fa-solid fa-search', event: 'window.open(`https://cn.bing.com/search?q=${__text__}`)', group: 'seletctText'}
955
966
  #- {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__ 为链接地址
967
+ # 链接判断组件
968
+ # 生效于链接处的右键行为,__link__ 为链接地址
958
969
  elementCheck:
959
970
  - {id: 'openTab', name: '新标签页打开', icon: 'fa-solid fa-external-link-square-alt', event: 'window.open(__link__)', group: 'elementCheck'}
960
971
  - {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'}
972
+ # 图片判断类组件
973
+ # 生效于图片类的右键行为,__link__ 为链接地址
974
+ elementImage:
975
+ - {id: 'copyImg', name: '复制图片', icon: 'fa-solid fa-image', event: 'copyImg', group: 'elementImage'}
976
+ - {id: 'googleImg', name: '谷歌识图', icon: 'fa-solid fa-images', event: 'window.open(`https://www.google.com.hk/searchbyimage?image_url=${__link__}`)', group: 'elementImage'}
963
977
  # 文章页面组件
964
978
  # 生效于 post.article 页面
965
979
  articlePage:
@@ -974,7 +988,7 @@ rightmenus:
974
988
  - hr
975
989
  - {id: 'source_docs', name: '本站源码', icon: 'fa-solid fa-code-branch', link: 'https://github.com/volantis-x/volantis-docs/', group: 'link'}
976
990
  - {id: 'source_theme', name: '主题源码', icon: 'fa-solid fa-code-branch', link: 'https://github.com/volantis-x/hexo-theme-volantis/', group: 'link'}
977
- darkMode:
991
+ darkMode:
978
992
  - {id: 'darkMode', name: '暗黑模式', icon: 'fa-solid fa-moon', event: 'volantis.dark.toggle()', group: 'darkMode'}
979
993
  ###
980
994
 
@@ -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>