hexo-theme-volantis 5.8.1 → 6.0.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 (112) hide show
  1. package/CHANGELOG.md +3 -44
  2. package/_cdn.yml +449 -0
  3. package/_config.yml +155 -157
  4. package/languages/en.yml +9 -10
  5. package/languages/zh-CN.yml +11 -15
  6. package/languages/zh-TW.yml +10 -11
  7. package/layout/_meta/category.ejs +10 -5
  8. package/layout/_meta/counter.ejs +14 -17
  9. package/layout/_meta/tags.ejs +3 -0
  10. package/layout/_meta/walinecount.ejs +1 -1
  11. package/layout/_partial/article.ejs +8 -3
  12. package/layout/_partial/cover.ejs +4 -4
  13. package/layout/_partial/footer.ejs +1 -1
  14. package/layout/_partial/head.ejs +7 -18
  15. package/layout/_partial/header.ejs +6 -6
  16. package/layout/_partial/post.ejs +3 -3
  17. package/layout/_partial/scripts/_ctrl.ejs +43 -2
  18. package/layout/_partial/scripts/config.ejs +69 -0
  19. package/layout/_partial/scripts/global.ejs +137 -60
  20. package/layout/_partial/scripts/index.ejs +16 -23
  21. package/layout/_plugins/_page_plugins/artitalk/index.ejs +1 -1
  22. package/layout/_plugins/_page_plugins/bbtalk/index.ejs +1 -1
  23. package/layout/_plugins/_page_plugins/fcircle/index.ejs +9 -8
  24. package/layout/_plugins/_page_plugins/katex/index.ejs +3 -3
  25. package/layout/_plugins/_page_plugins/mathjax/index.ejs +1 -1
  26. package/layout/_plugins/aplayer/layout.ejs +31 -23
  27. package/layout/_plugins/aplayer/script.ejs +93 -65
  28. package/layout/_plugins/comments/artalk/script.ejs +31 -40
  29. package/layout/_plugins/comments/discuss/script.ejs +1 -1
  30. package/layout/_plugins/comments/disqusjs/script.ejs +2 -2
  31. package/layout/_plugins/comments/gitalk/script.ejs +1 -1
  32. package/layout/_plugins/comments/twikoo/script.ejs +1 -1
  33. package/layout/_plugins/comments/vssue/script.ejs +3 -3
  34. package/layout/_plugins/comments/waline/script.ejs +2 -2
  35. package/layout/_plugins/github-api/script.ejs +3 -3
  36. package/layout/_plugins/lazyload/script.ejs +1 -1
  37. package/layout/_plugins/nodewaves/script.ejs +1 -1
  38. package/layout/_plugins/pace/script.ejs +15 -0
  39. package/layout/_plugins/parallax/script.ejs +1 -1
  40. package/layout/_plugins/pjax/index.ejs +66 -11
  41. package/layout/_plugins/pjax/pdata.ejs +5 -5
  42. package/layout/_plugins/preload/script.ejs +2 -2
  43. package/layout/_plugins/rightmenus/layout.ejs +4 -4
  44. package/layout/_plugins/scrollreveal/script.ejs +2 -2
  45. package/layout/_plugins/search/script.ejs +11 -8
  46. package/layout/_plugins/swiper/script.ejs +2 -2
  47. package/layout/{_partial/scripts/toc.ejs → _plugins/toc/script.ejs} +40 -36
  48. package/layout/_widget/webinfo.ejs +13 -14
  49. package/layout/friends.ejs +2 -2
  50. package/layout/layout.ejs +1 -15
  51. package/package.json +4 -4
  52. package/scripts/events/lib/cdn.js +206 -0
  53. package/scripts/events/lib/check-configuration.js +7 -7
  54. package/scripts/events/lib/check-environment.js +17 -17
  55. package/scripts/events/lib/config.js +0 -24
  56. package/scripts/events/lib/render-stylus.js +5 -5
  57. package/scripts/events/lib/stellar-tag-utils.js +2 -2
  58. package/scripts/filters/hexo-blog-encrypt-callback.js +44 -0
  59. package/scripts/filters/img.js +1 -1
  60. package/scripts/filters/replace.js +3 -3
  61. package/scripts/filters/z-lazyload.js +3 -5
  62. package/scripts/helpers/first-style.js +2 -2
  63. package/scripts/helpers/head/generate_seo.js +11 -9
  64. package/scripts/helpers/head/generate_title__keywords__description.js +19 -6
  65. package/scripts/helpers/related-posts.js +3 -3
  66. package/scripts/helpers/structured-data/lib/blogposting.js +1 -1
  67. package/scripts/helpers/structured-data/lib/breadcrumblist.js +1 -1
  68. package/scripts/helpers/structured-data/lib/config.js +1 -1
  69. package/scripts/helpers/structured-data/lib/website.js +1 -1
  70. package/scripts/helpers//346/226/207/347/253/240/346/216/250/350/215/220.js +184 -0
  71. package/scripts/tags/btn.js +2 -2
  72. package/scripts/tags/btns.js +3 -3
  73. package/scripts/tags/checkbox.js +6 -6
  74. package/scripts/tags/contributors.js +7 -7
  75. package/scripts/tags/dropmenu.js +8 -8
  76. package/scripts/tags/fancybox.js +6 -6
  77. package/scripts/tags/folding.js +5 -5
  78. package/scripts/tags/frame.js +3 -3
  79. package/scripts/tags/friends.js +8 -8
  80. package/scripts/tags/ghcard.js +7 -7
  81. package/scripts/tags/image.js +6 -6
  82. package/scripts/tags/inline-labels.js +6 -6
  83. package/scripts/tags/link.js +5 -5
  84. package/scripts/tags/md.js +4 -4
  85. package/scripts/tags/media.js +5 -5
  86. package/scripts/tags/note.js +12 -12
  87. package/scripts/tags/pandown.js +29 -29
  88. package/scripts/tags/site.js +4 -4
  89. package/scripts/tags/span.js +4 -4
  90. package/scripts/tags/table.js +2 -2
  91. package/scripts/tags/tabs.js +23 -23
  92. package/scripts/tags/timeline.js +5 -5
  93. package/source/css/_first/base_first.styl +1 -1
  94. package/source/css/_style/_layout/article.styl +43 -0
  95. package/source/css/_style/_layout/main.styl +1 -1
  96. package/source/css/_style/_layout/search.styl +206 -14
  97. package/source/css/_style/_plugins/index.styl +1 -3
  98. package/source/js/app.js +133 -160
  99. package/source/js/plugins/parallax.js +1 -1
  100. package/source/js/plugins/rightMenus.js +24 -20
  101. package/source/js/search/algolia.js +239 -0
  102. package/source/js/search/hexo.js +8 -2
  103. package/source/js/search/meilisearch.js +220 -0
  104. package/layout/_partial/scripts/_ctrl/cdnCtrl.ejs +0 -127
  105. package/layout/_partial/scripts/_ctrl/coverCtrl.ejs +0 -43
  106. package/layout/_plugins/analytics/LCCounter.ejs +0 -207
  107. package/layout/_plugins/pjax/animate.ejs +0 -31
  108. package/layout/_plugins/rightmenu/layout.ejs +0 -119
  109. package/scripts/helpers/revisioned.js +0 -167
  110. package/source/css/_style/_plugins/pjaxanimate.styl +0 -160
  111. package/source/js/plugins/rightMenu.js +0 -577
  112. /package/layout/{_partial/scripts/content-visibility-scroll-fix.ejs → _plugins/content-visibility/script.ejs} +0 -0
@@ -1,51 +1,109 @@
1
1
  <script>
2
2
  /************这个文件存放不需要重载的全局变量和全局函数*********/
3
- window.volantis = {}; // volantis 全局变量
4
- volantis.debug = "<%- theme.debug %>"; // 调试模式
5
- volantis.dom = {}; // 页面Dom see: /source/js/app.js etc.
3
+ // window.volantis = {}; // volantis 全局变量
4
+ /**
5
+ * 内存安全的全局 volantis 对象实现
6
+ * 特性:
7
+ * 1. 支持 window.volantis.xxx = yyy 直观赋值语法
8
+ * 2. 基于 WeakMap 存储数据,自动回收内存
9
+ * 3. 支持属性枚举(如 Object.keys(window.volantis))
10
+ * 4. 支持删除属性(delete window.volantis.xxx)
11
+ */
12
+ (function initializeVolantis() {
13
+ // 1. 初始化 WeakMap 存储实际数据(键:volantisProxy 实例,值:属性键值对)
14
+ const volantisDataStore = new WeakMap();
6
15
 
7
- volantis.GLOBAL_CONFIG ={
8
- debug: <%- JSON.stringify(theme.debug) %>,
9
- cdn: <%- JSON.stringify(theme.cdn.map) %>,
10
- default: <%- JSON.stringify(theme.default) %>,
11
- lastupdate: new Date(<%- theme.getStartTime %>),
12
- sidebar: {
13
- for_page: <%- JSON.stringify(theme.sidebar.for_page) %>,
14
- for_post: <%- JSON.stringify(theme.sidebar.for_post) %>,
15
- webinfo: {
16
- lastupd: {
17
- enable: <%- JSON.stringify(theme.sidebar.widget_library.webinfo.type.lastupd.enable) %>,
18
- friendlyShow: <%- JSON.stringify(theme.sidebar.widget_library.webinfo.type.lastupd.friendlyShow) %>
19
- },
20
- runtime: {
21
- data: <%- JSON.stringify(theme.sidebar.widget_library.webinfo.type.runtime.data) %>,
22
- unit: <%- JSON.stringify(theme.sidebar.widget_library.webinfo.type.runtime.unit) %>
23
- }
16
+ // 2. 创建 Proxy 代理处理属性访问
17
+ const volantisProxy = new Proxy({}, {
18
+ /**
19
+ * 拦截属性读取(如 window.volantis.dom)
20
+ * @param {Object} target - 代理目标对象(仅作为占位符,不存储数据)
21
+ * @param {string} prop - 访问的属性名
22
+ * @returns {any} 属性值或 undefined
23
+ */
24
+ get(target, prop) {
25
+ const data = volantisDataStore.get(volantisProxy);
26
+ return data?.[prop]; // 使用可选链避免数据未初始化时的错误
27
+ },
28
+
29
+ /**
30
+ * 拦截属性赋值(如 window.volantis.dom = "a")
31
+ * @param {Object} target - 代理目标对象
32
+ * @param {string} prop - 赋值的属性名
33
+ * @param {any} value - 赋值的属性值
34
+ * @returns {boolean} 赋值是否成功
35
+ */
36
+ set(target, prop, value) {
37
+ // 初始化数据容器(若不存在)
38
+ if (!volantisDataStore.has(volantisProxy)) {
39
+ volantisDataStore.set(volantisProxy, Object.create(null)); // 使用无原型对象避免原型污染
40
+ }
41
+ // 存储属性值
42
+ const data = volantisDataStore.get(volantisProxy);
43
+ data[prop] = value;
44
+ return true; // 符合 Proxy 规范,返回成功标志
45
+ },
46
+
47
+ /**
48
+ * 拦截属性删除(如 delete window.volantis.dom)
49
+ * @param {Object} target - 代理目标对象
50
+ * @param {string} prop - 要删除的属性名
51
+ * @returns {boolean} 删除是否成功
52
+ */
53
+ deleteProperty(target, prop) {
54
+ const data = volantisDataStore.get(volantisProxy);
55
+ if (!data || !Object.prototype.hasOwnProperty.call(data, prop)) {
56
+ return false; // 属性不存在,删除失败
57
+ }
58
+ delete data[prop];
59
+ // 若数据为空,清理 WeakMap 条目(优化内存回收)
60
+ if (Object.keys(data).length === 0) {
61
+ volantisDataStore.delete(volantisProxy);
24
62
  }
63
+ return true;
25
64
  },
26
- plugins: {
27
- message: <%- JSON.stringify(theme.plugins.message) %>,
28
- fancybox: <%- JSON.stringify(theme.plugins.fancybox) %>,
29
- <% if(theme.plugins.aplayer.enable) { %>
30
- aplayer: {
31
- id: <%- JSON.stringify(theme.plugins.aplayer.id) %>,
32
- enable:<%- JSON.stringify(theme.plugins.aplayer.enable) %>
33
- },
34
- <% } %>
35
- <% if(theme.rightmenu.enable) { %>
36
- rightmenu: {
37
- faicon: <%- JSON.stringify(theme.rightmenu.faicon) %>,
38
- layout: <%- JSON.stringify(theme.rightmenu.layout) %>,
39
- music_alwaysShow: <%- JSON.stringify(theme.rightmenu.music.alwaysShow) %>,
40
- customPicUrl: <%- JSON.stringify(theme.rightmenu.customPicUrl) %>
41
- },
42
- <% } %>
43
- <% if(theme.rightmenus.enable) { %>
44
- rightmenus: <%- JSON.stringify(theme.rightmenus) %>
45
- <% } %>
65
+
66
+ /**
67
+ * 拦截属性枚举(如 Object.keys(window.volantis)
68
+ * @param {Object} target - 代理目标对象
69
+ * @returns {string[]} 可枚举的属性名数组
70
+ */
71
+ ownKeys(target) {
72
+ const data = volantisDataStore.get(volantisProxy);
73
+ return data ? Object.keys(data) : [];
74
+ },
75
+
76
+ /**
77
+ * 拦截属性描述符查询(如 Object.getOwnPropertyDescriptor)
78
+ * @param {Object} target - 代理目标对象
79
+ * @param {string} prop - 属性名
80
+ * @returns {PropertyDescriptor|undefined} 属性描述符
81
+ */
82
+ getOwnPropertyDescriptor(target, prop) {
83
+ const data = volantisDataStore.get(volantisProxy);
84
+ if (!data || !Object.prototype.hasOwnProperty.call(data, prop)) {
85
+ return undefined;
86
+ }
87
+ return {
88
+ value: data[prop],
89
+ writable: true,
90
+ enumerable: true,
91
+ configurable: true
92
+ };
46
93
  }
47
- }
94
+ });
95
+
96
+ // 3. 挂载到 window 对象,暴露全局访问入口
97
+ Object.defineProperty(window, 'volantis', {
98
+ value: volantisProxy,
99
+ writable: true, // 允许后续手动设置为 null 触发清理
100
+ configurable: true,
101
+ enumerable: true
102
+ });
48
103
 
104
+ })();
105
+ volantis.debug = "<%- theme.debug %>"; // 调试模式
106
+ volantis.dom = {}; // 页面Dom see: /source/js/app.js etc.
49
107
  /******************** volantis.EventListener ********************************/
50
108
  // 事件监听器 see: /source/js/app.js
51
109
  volantis.EventListener = {}
@@ -62,7 +120,8 @@
62
120
  volantis.EventListener.list.forEach(function (i) {
63
121
  i.ele.removeEventListener(i.type, i.f, false)
64
122
  })
65
- volantis.EventListener.list = []
123
+ volantis.EventListener.list = null;
124
+ volantis.EventListener.list = [];
66
125
  }
67
126
  /******************** volantis.dom.$ ********************************/
68
127
  // 注:这里没有选择器,也没有forEach一次只处理一个dom,这里重新封装主题常用的dom方法,返回的是dom对象,对象包含了以下方法,同时保留dom的原生API
@@ -147,18 +206,18 @@
147
206
  this.push = (fn, name, setRequestAnimationFrame = true) => {
148
207
  let myfn = fn
149
208
  if (setRequestAnimationFrame) {
150
- myfn = ()=>{
209
+ myfn = () => {
151
210
  volantis.requestAnimationFrame(fn)
152
211
  }
153
212
  }
154
213
  var f = new Item(myfn, name);
155
214
  this.list.push(f);
156
215
  };
157
- this.remove = (name) =>{
216
+ this.remove = (name) => {
158
217
  for (let index = 0; index < this.list.length; index++) {
159
218
  const e = this.list[index];
160
219
  if (e.name == name) {
161
- this.list.splice(index,1);
220
+ this.list.splice(index, 1);
162
221
  }
163
222
  }
164
223
  }
@@ -280,7 +339,7 @@
280
339
  volantis.import = {
281
340
  jQuery: () => {
282
341
  if (typeof jQuery == "undefined") {
283
- return volantis.js("<%- theme.plugins.jquery %>")
342
+ return volantis.js("<%- theme.cdn.jquery %>")
284
343
  } else {
285
344
  return new Promise(resolve => {
286
345
  resolve()
@@ -291,19 +350,19 @@
291
350
  /********************** requestAnimationFrame ********************************/
292
351
  // 1、requestAnimationFrame 会把每一帧中的所有 DOM 操作集中起来,在一次重绘或回流中就完成,并且重绘或回流的时间间隔紧紧跟随浏览器的刷新频率,一般来说,这个频率为每秒60帧。
293
352
  // 2、在隐藏或不可见的元素中,requestAnimationFrame 将不会进行重绘或回流,这当然就意味着更少的的 cpu,gpu 和内存使用量。
294
- volantis.requestAnimationFrame = (fn)=>{
353
+ volantis.requestAnimationFrame = (fn) => {
295
354
  if (!window.requestAnimationFrame) {
296
355
  window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame;
297
356
  }
298
357
  window.requestAnimationFrame(fn)
299
358
  }
300
359
  /************************ layoutHelper *****************************************/
301
- volantis.layoutHelper = (helper, html, opt)=>{
302
- opt = Object.assign({clean:false, pjax:true}, opt)
360
+ volantis.layoutHelper = (helper, html, opt) => {
361
+ opt = Object.assign({ clean: false, pjax: true }, opt)
303
362
  function myhelper(helper, html, clean) {
304
363
  volantis.tempDiv = document.createElement("div");
305
364
  volantis.tempDiv.innerHTML = html;
306
- let layoutHelper = document.querySelector("#layoutHelper-"+helper)
365
+ let layoutHelper = document.querySelector("#layoutHelper-" + helper)
307
366
  if (layoutHelper) {
308
367
  if (clean) {
309
368
  layoutHelper.innerHTML = ""
@@ -313,9 +372,9 @@
313
372
  }
314
373
  myhelper(helper, html, opt.clean)
315
374
  if (opt.pjax) {
316
- volantis.pjax.push(()=>{
375
+ volantis.pjax.push(() => {
317
376
  myhelper(helper, html, opt.clean)
318
- },"layoutHelper-"+helper)
377
+ }, "layoutHelper-" + helper)
319
378
  }
320
379
  }
321
380
  /****************************** 滚动事件处理 ****************************************/
@@ -327,7 +386,7 @@
327
386
  push: volantis.scroll.engine.push,
328
387
  });
329
388
  // 滚动条距离顶部的距离
330
- volantis.scroll.getScrollTop = () =>{
389
+ volantis.scroll.getScrollTop = () => {
331
390
  let scrollPos;
332
391
  if (window.pageYOffset) {
333
392
  scrollPos = window.pageYOffset;
@@ -338,6 +397,23 @@
338
397
  }
339
398
  return scrollPos;
340
399
  }
400
+ volantis.scroll.scrollHeight = function () {
401
+ return Math.max(
402
+ document.body.scrollHeight,
403
+ document.documentElement.scrollHeight,
404
+ )
405
+ }
406
+ volantis.scroll.offsetHeight = function () {
407
+ return Math.max(
408
+ document.body.offsetHeight,
409
+ document.documentElement.offsetHeight,
410
+ document.body.clientHeight,
411
+ document.documentElement.clientHeight
412
+ )
413
+ }
414
+ volantis.scroll.progress = function () {
415
+ return volantis.scroll.getScrollTop() / (volantis.scroll.scrollHeight() - volantis.scroll.offsetHeight())
416
+ }
341
417
  // 使用 requestAnimationFrame 处理滚动事件
342
418
  // `volantis.scroll.del` 中存储了一个数值, 该数值检测一定时间间隔内滚动条滚动的位移, 数值的检测频率是浏览器的刷新频率. 数值为正数时, 表示向下滚动. 数值为负数时, 表示向上滚动.
343
419
  volantis.scroll.handleScrollEvents = () => {
@@ -353,9 +429,9 @@
353
429
  // console.log("向上滚动");
354
430
  // }
355
431
  // 注销过期的unengine未滚动事件
356
- volantis.scroll.unengine.list=[]
432
+ volantis.scroll.unengine.list = []
357
433
  volantis.scroll.engine.start();
358
- }else{
434
+ } else {
359
435
  volantis.scroll.unengine.start();
360
436
  }
361
437
  volantis.requestAnimationFrame(loop)
@@ -399,22 +475,22 @@
399
475
  }
400
476
  volantis.scroll.unengine.push(() => {
401
477
  let me = ele.getBoundingClientRect().top
402
- if(!(me >= -option.observerDic && me <= option.observerDic)){
478
+ if (!(me >= -option.observerDic && me <= option.observerDic)) {
403
479
  volantis.scroll.to(ele, option)
404
480
  }
405
481
  volantis.scroll.unengine.remove("unengineObserver")
406
- },"unengineObserver")
407
- },1000)
482
+ }, "unengineObserver")
483
+ }, 1000)
408
484
  }
409
485
  }
410
486
  /********************** Content Visibility ********************************/
411
487
  // 见 source/css/first.styl 如果遇到任何问题 删除 .post-story 即可
412
488
  // 一个元素被声明 content-visibility 属性后 如果元素不在 viewport 中 浏览器不会计算其后代元素样式和属性 从而节省 Style & Layout 耗时
413
489
  // content-visibility 的副作用: 锚点失效 等等(实验初期 暂不明确), 使用此方法清除样式
414
- volantis.cleanContentVisibility = ()=>{
490
+ volantis.cleanContentVisibility = () => {
415
491
  if (document.querySelector(".post-story")) {
416
492
  console.log("cleanContentVisibility");
417
- document.querySelectorAll(".post-story").forEach(e=>{
493
+ document.querySelectorAll(".post-story").forEach(e => {
418
494
  e.classList.remove("post-story")
419
495
  })
420
496
  }
@@ -433,3 +509,4 @@
433
509
  }
434
510
  /******************************************************************************/
435
511
  </script>
512
+ <%- partial('./config') %>
@@ -13,27 +13,23 @@
13
13
 
14
14
  <script>
15
15
  <% if (theme.plugins.fontawesome) { %>
16
- volantis.css("<%- theme.plugins.fontawesome %>");
16
+ volantis.css("<%- theme.cdn.fontawesome %>");
17
17
  <% } %>
18
18
  <% if (theme.plugins.fontawesome_animation.enable) { %>
19
- volantis.css("<%- theme.plugins.fontawesome_animation.css %>");
19
+ volantis.css("<%- theme.cdn['font-awesome-animation'] %>");
20
20
  <% } %>
21
21
  <% if (theme.plugins.nodewaves.enable) { %>
22
- volantis.css("<%- theme.plugins.nodewaves.css %>");
22
+ volantis.css("<%- theme.cdn.nodewaves_css %>");
23
23
  <% } %>
24
24
  </script>
25
25
 
26
26
  <!-- required -->
27
27
  <% if (theme.plugins.globalJquery) { %>
28
- <%- js(theme.plugins.jquery) %>
28
+ <%- js(theme.cdn.jquery) %>
29
29
  <% } %>
30
30
 
31
31
  <!-- internal -->
32
- <%- js(theme.cdn.map.js.app) %>
33
-
34
- <% if (theme.rightmenu.enable) { %>
35
- <%- partial('../../_plugins/rightmenu/layout') %>
36
- <% } %>
32
+ <script src="<%- theme.cdn.volantis_app %>"></script>
37
33
 
38
34
  <% if (theme.rightmenus.enable) { %>
39
35
  <%- partial('../../_plugins/rightmenus/layout') %>
@@ -56,11 +52,11 @@
56
52
  <%- partial('../../_plugins/preload/script') %>
57
53
  <% } %>
58
54
 
59
- <% if (theme.plugins.scrollreveal.enable && theme.plugins.scrollreveal.js) { %>
55
+ <% if (theme.plugins.scrollreveal.enable) { %>
60
56
  <%- partial('../../_plugins/scrollreveal/script') %>
61
57
  <% } %>
62
58
 
63
- <% if (theme.plugins.aplayer && theme.plugins.aplayer.enable && theme.plugins.aplayer.js) { %>
59
+ <% if (theme.plugins.aplayer && theme.plugins.aplayer.enable) { %>
64
60
  <%- partial('../../_plugins/aplayer/script') %>
65
61
  <% } %>
66
62
 
@@ -86,8 +82,8 @@
86
82
 
87
83
 
88
84
 
89
- <% if (theme.analytics.busuanzi) { %>
90
- <script defer src="<%- theme.analytics.busuanzi %>" data-pjax></script>
85
+ <% if (theme.plugins.busuanzi.enable) { %>
86
+ <script defer src="<%- theme.cdn.busuanzi %>" data-pjax></script>
91
87
  <% } %>
92
88
 
93
89
  <!-- optional -->
@@ -100,17 +96,13 @@
100
96
  <% } %>
101
97
 
102
98
  <% if (theme.plugins.comment_typing.enable) { %>
103
- <%- js(theme.plugins.comment_typing.js) %>
99
+ <%- js(theme.cdn.comment_typing) %>
104
100
  <% } %>
105
101
 
106
102
  <% if (theme.plugins.code_highlight) { %>
107
103
  <%- partial('../../_plugins/highlight/script') %>
108
104
  <% } %>
109
105
 
110
- <% if (theme.analytics && theme.analytics.leancloud && theme.analytics.leancloud.app_id) { %>
111
- <%- partial('../../_plugins/analytics/LCCounter') %>
112
- <% } %>
113
-
114
106
  <% if (config.google_analytics_key || config.baidu_analytics_key || config.tencent_aegis_id || config.v6_51_la || config.perf_51_la) { %>
115
107
  <%- partial('../../_plugins/analytics/script') %>
116
108
  <% } %>
@@ -127,6 +119,10 @@
127
119
  <%- partial('../../_plugins/swiper/script') %>
128
120
  <% } %>
129
121
 
122
+ <% if (theme.plugins.pace.enable) { %>
123
+ <%- partial('../../_plugins/pace/script') %>
124
+ <% } %>
125
+
130
126
  <!-- pjax 标签必须存在于所有页面 否则 pjax error -->
131
127
  <pjax>
132
128
  <% if (page.plugins) { %>
@@ -134,15 +130,12 @@
134
130
  <% } %>
135
131
  </pjax>
136
132
 
137
- <%- partial('toc') %>
133
+ <%- partial('../../_plugins/toc/script') %>
138
134
 
139
135
  <% if (theme.content_visibility) { %>
140
- <%- partial('content-visibility-scroll-fix') %>
136
+ <%- partial('../../_plugins/content-visibility/script') %>
141
137
  <% } %>
142
138
 
143
139
  <%- partial('../../_plugins/slow-network/script') %>
144
140
 
145
- <% if (theme.structured_data && theme.structured_data.enable) { %>
146
- <%- structured_data() %>
147
- <% } %>
148
141
 
@@ -3,7 +3,7 @@
3
3
  </script>
4
4
  <script>
5
5
  volantis.import.jQuery().then(()=>{
6
- volantis.js("<%= theme.plugins.artitalk.js %>").then(()=>{
6
+ volantis.js("<%= theme.cdn.artitalk %>").then(()=>{
7
7
  new Artitalk(Object.assign(<%- JSON.stringify(theme.plugins.artitalk) %>, {}))
8
8
  })
9
9
  })
@@ -3,7 +3,7 @@
3
3
  </script>
4
4
  <script>
5
5
  volantis.import.jQuery().then(()=>{
6
- volantis.js("<%= theme.plugins.bbtalk.js %>").then(()=>{
6
+ volantis.js("<%= theme.cdn.bbtalk %>").then(()=>{
7
7
  bbtalk.init(Object.assign(<%- JSON.stringify(theme.plugins.bbtalk) %>, {}))
8
8
  })
9
9
  })
@@ -1,12 +1,13 @@
1
1
  <script>
2
- volantis.layoutHelper("page-plugins",`<div class="post-content"><div id="cf-container"><%- theme.plugins.fcircle.message %></div></div>`,{pjax:false}) // 外层有 pjax 标签
2
+ volantis.layoutHelper("page-plugins", `<div id="hexo-circle-of-friends-root"></div>`, { pjax: false }) // 外层有 pjax 标签
3
3
  </script>
4
- <script type="text/javascript">
5
- var fdataUser = {
6
- apiurl: '<%- theme.plugins.fcircle.api %>'
4
+ <script>
5
+ let UserConfig = {
6
+ private_api_url: '<%- theme.plugins.fcircle.private_api_url %>',
7
+ page_turning_number: '<%- theme.plugins.fcircle.page_turning_number %>',
8
+ error_img: '<%- theme.plugins.fcircle.error_img%>',
9
+ sort_rule: '<%- theme.plugins.fcircle.sort_rule %>'
7
10
  }
8
11
  </script>
9
- <link rel="stylesheet" href="<%- theme.plugins.fcircle.css %>">
10
- <script type="text/javascript"
11
- src="<%- theme.plugins.fcircle.js %>">
12
- </script>
12
+ <script type="text/javascript" src="<%- theme.plugins.fcircle.app %>"></script>
13
+ <script type="text/javascript" src="<%- theme.plugins.fcircle.bundle %>"></script>
@@ -1,13 +1,13 @@
1
1
  <script>
2
2
  // https://www.micdz.cn/article/katex-on-volantis/
3
3
  if (typeof renderMathInElement == "undefined") {
4
- volantis.css("<%= theme.plugins.katex.css %>")
4
+ volantis.css("<%= theme.cdn.katex_css %>")
5
5
  function pjax_katex() {
6
- volantis.js("<%= theme.plugins.katex.render %>").then(()=>{
6
+ volantis.js("<%= theme.cdn.katex_render %>").then(()=>{
7
7
  renderMathInElement(document.body);
8
8
  })
9
9
  }
10
- volantis.js("<%= theme.plugins.katex.js %>").then(pjax_katex)
10
+ volantis.js("<%= theme.cdn.katex_js %>").then(pjax_katex)
11
11
  volantis.pjax.push(pjax_katex)
12
12
  }
13
13
  </script>
@@ -38,7 +38,7 @@
38
38
  };
39
39
  (function () {
40
40
  var script = document.createElement('script');
41
- script.src = "<%= theme.plugins.mathjax %>";
41
+ script.src = "<%= theme.cdn.mathjax %>";
42
42
  script.defer = true;
43
43
  document.head.appendChild(script);
44
44
  })();
@@ -2,29 +2,37 @@
2
2
  let aplayer = theme.plugins.aplayer;
3
3
  %>
4
4
  <% if (theme.plugins.aplayer.enable == true) { %>
5
- <% if (post && post.music) { %>
6
- <meting-js
7
- mini='true'
8
- volume='<%- post.music.volume || aplayer.volume %>'
9
- loop='<%- post.music.loop || aplayer.loop %>'
10
- order='<%- post.music.order || aplayer.order %>'
11
- server='<%- post.music.server || aplayer.server %>'
12
- type='<%- post.music.type || aplayer.type %>'
13
- id='<%- post.music.id || aplayer.id %>'>
14
- </meting-js>
5
+ <% if (aplayer.source == "meting") { %>
6
+ <% if (post && post.music) { %>
7
+ <meting-js
8
+ mini='true'
9
+ volume='<%- post.music.volume || aplayer.volume %>'
10
+ loop='<%- post.music.loop || aplayer.loop %>'
11
+ order='<%- post.music.order || aplayer.order %>'
12
+ server='<%- post.music.server || aplayer.server %>'
13
+ type='<%- post.music.type || aplayer.type %>'
14
+ id='<%- post.music.id || aplayer.id %>'>
15
+ </meting-js>
16
+ <% } else { %>
17
+ <meting-js
18
+ theme='<%- aplayer.theme %>'
19
+ autoplay='<%- aplayer.autoplay %>'
20
+ volume='<%- aplayer.volume %>'
21
+ loop='<%- aplayer.loop %>'
22
+ order='<%- aplayer.order %>'
23
+ fixed='<%- aplayer.fixed %>'
24
+ list-max-height='<%- aplayer.list_max_height %>'
25
+ server='<%- aplayer.server %>'
26
+ type='<%- aplayer.type %>'
27
+ id='<%- aplayer.id %>'
28
+ list-folded='<%- aplayer.list_folded %>'>
29
+ </meting-js>
30
+ <% } %>
15
31
  <% } else { %>
16
- <meting-js
17
- theme='<%- aplayer.theme %>'
18
- autoplay='<%- aplayer.autoplay %>'
19
- volume='<%- aplayer.volume %>'
20
- loop='<%- aplayer.loop %>'
21
- order='<%- aplayer.order %>'
22
- fixed='<%- aplayer.fixed %>'
23
- list-max-height='<%- aplayer.list_max_height %>'
24
- server='<%- aplayer.server %>'
25
- type='<%- aplayer.type %>'
26
- id='<%- aplayer.id %>'
27
- list-folded='<%- aplayer.list_folded %>'>
28
- </meting-js>
32
+ <% if (post && post.music) { %>
33
+ <div class="aplayer-local-min"></div>
34
+ <% } else { %>
35
+ <div class="aplayer-local"></div>
36
+ <% } %>
29
37
  <% } %>
30
38
  <% } %>