hexo-component-inferno 3.1.2 → 4.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 (161) hide show
  1. package/asset/js/algolia.js +51 -10
  2. package/asset/js/google_cse.js +50 -7
  3. package/asset/js/insight.js +48 -7
  4. package/lib/hexo/filter/locals.js +2 -2
  5. package/lib/hexo/helper/cdn.js +10 -2
  6. package/lib/schema/comment/artalk.json +37 -0
  7. package/lib/schema/comment/beaudar.json +62 -0
  8. package/lib/schema/comment/cusdis.json +34 -0
  9. package/lib/schema/comment/giscus.json +7 -1
  10. package/lib/schema/comment/utterances.json +15 -1
  11. package/lib/schema/comment/valine.json +2 -2
  12. package/lib/schema/comment/waline.json +1 -1
  13. package/lib/schema/plugin/matomo.json +25 -0
  14. package/lib/schema/plugin/umami.json +25 -0
  15. package/lib/schema/plugin/waline_pageview.json +14 -0
  16. package/lib/schema/search/algolia.json +4 -0
  17. package/lib/schema/widget/archives.json +5 -0
  18. package/lib/schema/widget/categories.json +5 -0
  19. package/lib/schema/widget/tags.json +1 -1
  20. package/lib/util/appearance.js +40 -0
  21. package/lib/util/i18n.js +24 -0
  22. package/lib/util/script.js +110 -0
  23. package/lib/view/comment/artalk.js +118 -0
  24. package/lib/view/comment/beaudar.js +133 -0
  25. package/lib/view/comment/changyan.js +5 -5
  26. package/lib/view/comment/cusdis.js +119 -0
  27. package/lib/view/comment/disqus.js +1 -1
  28. package/lib/view/comment/disqusjs.js +6 -5
  29. package/lib/view/comment/facebook.js +1 -1
  30. package/lib/view/comment/giscus.js +32 -22
  31. package/lib/view/comment/gitalk.js +6 -5
  32. package/lib/view/comment/gitment.js +6 -5
  33. package/lib/view/comment/isso.js +7 -3
  34. package/lib/view/comment/livere.js +1 -1
  35. package/lib/view/comment/twikoo.js +3 -4
  36. package/lib/view/comment/utterances.js +26 -17
  37. package/lib/view/comment/valine.js +3 -6
  38. package/lib/view/comment/waline.js +16 -9
  39. package/lib/view/common/article_media.js +2 -2
  40. package/lib/view/donate/afdian.js +1 -1
  41. package/lib/view/donate/alipay.js +1 -1
  42. package/lib/view/donate/buymeacoffee.js +1 -1
  43. package/lib/view/donate/patreon.js +1 -1
  44. package/lib/view/donate/paypal.js +1 -1
  45. package/lib/view/donate/wechat.js +1 -1
  46. package/lib/view/misc/article_licensing.js +1 -1
  47. package/lib/view/misc/meta.js +1 -1
  48. package/lib/view/misc/open_graph.js +1 -1
  49. package/lib/view/misc/paginator.js +9 -5
  50. package/lib/view/misc/structured_data.js +1 -1
  51. package/lib/view/misc/web_app.js +2 -2
  52. package/lib/view/plugin/baidu_analytics.js +1 -1
  53. package/lib/view/plugin/bing_webmaster.js +1 -1
  54. package/lib/view/plugin/busuanzi.js +1 -1
  55. package/lib/view/plugin/cnzz.js +1 -1
  56. package/lib/view/plugin/cookie_consent.js +1 -1
  57. package/lib/view/plugin/gallery.js +2 -2
  58. package/lib/view/plugin/google_analytics.js +1 -1
  59. package/lib/view/plugin/hotjar.js +1 -1
  60. package/lib/view/plugin/katex.js +1 -1
  61. package/lib/view/plugin/mathjax.js +1 -1
  62. package/lib/view/plugin/matomo.js +89 -0
  63. package/lib/view/plugin/outdated_browser.js +1 -1
  64. package/lib/view/plugin/progressbar.js +1 -1
  65. package/lib/view/plugin/statcounter.js +1 -1
  66. package/lib/view/plugin/twitter_conversion_tracking.js +1 -1
  67. package/lib/view/plugin/umami.js +88 -0
  68. package/lib/view/plugin/waline_pageview.js +98 -0
  69. package/lib/view/search/algolia.js +11 -5
  70. package/lib/view/search/baidu.js +5 -3
  71. package/lib/view/search/google_cse.js +4 -2
  72. package/lib/view/search/insight.js +1 -1
  73. package/lib/view/share/addthis.js +1 -1
  74. package/lib/view/share/addtoany.js +1 -1
  75. package/lib/view/share/bdshare.js +1 -1
  76. package/lib/view/share/sharejs.js +1 -1
  77. package/lib/view/share/sharethis.js +1 -1
  78. package/lib/view/widget/adsense.js +1 -1
  79. package/lib/view/widget/archives.js +45 -12
  80. package/lib/view/widget/categories.js +23 -7
  81. package/lib/view/widget/followit.js +1 -1
  82. package/lib/view/widget/links.js +1 -1
  83. package/lib/view/widget/recent_posts.js +1 -1
  84. package/lib/view/widget/subscribe_email.js +1 -1
  85. package/lib/view/widget/tags.js +19 -6
  86. package/lib/view/widget/toc.js +1 -1
  87. package/package.json +10 -5
  88. package/lib/core/migrate.test.js +0 -48
  89. package/lib/core/schema.test.js +0 -520
  90. package/lib/core/view.test.js +0 -41
  91. package/lib/hexo/filter/locals.test.js +0 -118
  92. package/lib/hexo/generator/assets.test.js +0 -32
  93. package/lib/hexo/generator/categories.test.js +0 -41
  94. package/lib/hexo/generator/category.test.js +0 -84
  95. package/lib/hexo/generator/insight.test.js +0 -95
  96. package/lib/hexo/generator/manifest.test.js +0 -52
  97. package/lib/hexo/generator/tags.test.js +0 -41
  98. package/lib/hexo/helper/cdn.test.js +0 -128
  99. package/lib/hexo/helper/page.test.js +0 -62
  100. package/lib/hexo/tag/message.test.js +0 -72
  101. package/lib/hexo/tag/tabs.test.js +0 -98
  102. package/lib/schema/schema/comment/changyan.json +0 -21
  103. package/lib/schema/schema/comment/disqus.json +0 -17
  104. package/lib/schema/schema/comment/disqusjs.json +0 -53
  105. package/lib/schema/schema/comment/facebook.json +0 -13
  106. package/lib/schema/schema/comment/giscus.json +0 -105
  107. package/lib/schema/schema/comment/gitalk.json +0 -81
  108. package/lib/schema/schema/comment/gitment.json +0 -47
  109. package/lib/schema/schema/comment/isso.json +0 -17
  110. package/lib/schema/schema/comment/livere.json +0 -17
  111. package/lib/schema/schema/comment/twikoo.json +0 -28
  112. package/lib/schema/schema/comment/utterances.json +0 -59
  113. package/lib/schema/schema/comment/valine.json +0 -105
  114. package/lib/schema/schema/comment/waline.json +0 -176
  115. package/lib/schema/schema/donate/afdian.json +0 -17
  116. package/lib/schema/schema/donate/alipay.json +0 -17
  117. package/lib/schema/schema/donate/buymeacoffee.json +0 -17
  118. package/lib/schema/schema/donate/patreon.json +0 -17
  119. package/lib/schema/schema/donate/paypal.json +0 -22
  120. package/lib/schema/schema/donate/wechat.json +0 -17
  121. package/lib/schema/schema/misc/manifest.json +0 -66
  122. package/lib/schema/schema/misc/meta.json +0 -11
  123. package/lib/schema/schema/misc/open_graph.json +0 -78
  124. package/lib/schema/schema/misc/poly_links.json +0 -35
  125. package/lib/schema/schema/misc/structured_data.json +0 -47
  126. package/lib/schema/schema/plugin/baidu_analytics.json +0 -14
  127. package/lib/schema/schema/plugin/bing_webmaster.json +0 -14
  128. package/lib/schema/schema/plugin/busuanzi.json +0 -7
  129. package/lib/schema/schema/plugin/cnzz.json +0 -19
  130. package/lib/schema/schema/plugin/cookie_consent.json +0 -38
  131. package/lib/schema/schema/plugin/gallery.json +0 -7
  132. package/lib/schema/schema/plugin/google_analytics.json +0 -14
  133. package/lib/schema/schema/plugin/hotjar.json +0 -14
  134. package/lib/schema/schema/plugin/katex.json +0 -7
  135. package/lib/schema/schema/plugin/mathjax.json +0 -7
  136. package/lib/schema/schema/plugin/outdated_browser.json +0 -7
  137. package/lib/schema/schema/plugin/progressbar.json +0 -7
  138. package/lib/schema/schema/plugin/statcounter.json +0 -19
  139. package/lib/schema/schema/plugin/twitter_conversion_tracking.json +0 -14
  140. package/lib/schema/schema/search/algolia.json +0 -13
  141. package/lib/schema/schema/search/baidu.json +0 -13
  142. package/lib/schema/schema/search/google_cse.json +0 -17
  143. package/lib/schema/schema/search/insight.json +0 -19
  144. package/lib/schema/schema/share/addthis.json +0 -17
  145. package/lib/schema/schema/share/addtoany.json +0 -13
  146. package/lib/schema/schema/share/bdshare.json +0 -13
  147. package/lib/schema/schema/share/sharejs.json +0 -13
  148. package/lib/schema/schema/share/sharethis.json +0 -17
  149. package/lib/schema/schema/widget/adsense.json +0 -21
  150. package/lib/schema/schema/widget/archives.json +0 -13
  151. package/lib/schema/schema/widget/categories.json +0 -13
  152. package/lib/schema/schema/widget/followit.json +0 -26
  153. package/lib/schema/schema/widget/links.json +0 -47
  154. package/lib/schema/schema/widget/recent_posts.json +0 -13
  155. package/lib/schema/schema/widget/subscribe_email.json +0 -22
  156. package/lib/schema/schema/widget/tags.json +0 -30
  157. package/lib/schema/schema/widget/toc.json +0 -31
  158. package/lib/util/cache.test.js +0 -24
  159. package/lib/util/classname.test.js +0 -13
  160. package/lib/util/yaml.test.js +0 -18
  161. package/lib/view/widget/toc.test.js +0 -30
@@ -8,7 +8,7 @@ function loadAlgolia(config, translation) {
8
8
 
9
9
  search.addWidgets([
10
10
  instantsearch.widgets.configure({
11
- attributesToSnippet: ['excerpt'],
11
+ attributesToSnippet: [config.excerpt],
12
12
  }),
13
13
  ]);
14
14
 
@@ -47,7 +47,7 @@ function loadAlgolia(config, translation) {
47
47
  },
48
48
  item: function (hit) {
49
49
  let title = instantsearch.highlight({ attribute: 'title', hit });
50
- let excerpt = instantsearch.highlight({ attribute: 'excerpt', hit });
50
+ let excerpt = instantsearch.highlight({ attribute: config.excerpt, hit });
51
51
  title = title ? title : translation.untitled;
52
52
  excerpt = excerpt
53
53
  .replace(new RegExp('<em>', 'ig'), '[algolia-highlight]')
@@ -88,15 +88,56 @@ function loadAlgolia(config, translation) {
88
88
  $('.searchbox').addClass('show');
89
89
  }
90
90
 
91
+ const $main = $('.searchbox');
92
+ let opener = null;
93
+
94
+ function open() {
95
+ if (!$main.hasClass('show')) {
96
+ opener = document.activeElement;
97
+ $main.addClass('show');
98
+ }
99
+ $main.find('.searchbox-input').focus();
100
+ }
101
+
102
+ // Return the focus to the element that opened the search box, unless it moved elsewhere
103
+ function close(restoreFocus = true) {
104
+ $main.removeClass('show');
105
+ if (restoreFocus && opener && document.contains(opener)) {
106
+ opener.focus();
107
+ }
108
+ opener = null;
109
+ }
110
+
111
+ // Open the search box with "/" (unless typing in a field) or Ctrl/Cmd+K
112
+ function isSearchShortcut(e) {
113
+ if (e.altKey) {
114
+ return false;
115
+ }
116
+ if (e.ctrlKey || e.metaKey) {
117
+ return !e.shiftKey && typeof e.key === 'string' && e.key.toLowerCase() === 'k';
118
+ }
119
+ // e.key is "/" whatever keys type it on the keyboard layout, so do not check e.shiftKey
120
+ const target = e.target;
121
+ const typing = target.isContentEditable || /^(input|textarea|select)$/i.test(target.tagName);
122
+ return e.key === '/' && !typing;
123
+ }
124
+
91
125
  $(document)
92
- .on('click', '.navbar-main .search', () => {
93
- $('.searchbox').toggleClass('show');
94
- $('.searchbox-input').focus();
95
- })
96
- .on('click', '.searchbox .searchbox-mask', () => {
97
- $('.searchbox').removeClass('show');
126
+ .on('click', '.navbar-main .search', open)
127
+ .on('click', '.searchbox .searchbox-mask', () => close())
128
+ .on('click', '.searchbox-close', () => close())
129
+ .on('focusin', (e) => {
130
+ // Close the search box when the focus moves to the rest of the page, e.g., by Tab
131
+ if ($main.hasClass('show') && !$main[0].contains(e.target)) {
132
+ close(false);
133
+ }
98
134
  })
99
- .on('click', '.searchbox-close', () => {
100
- $('.searchbox').removeClass('show');
135
+ .on('keydown', (e) => {
136
+ if (isSearchShortcut(e)) {
137
+ e.preventDefault();
138
+ open();
139
+ } else if (e.keyCode === 27 && $main.hasClass('show')) {
140
+ close();
141
+ }
101
142
  });
102
143
  }
@@ -16,15 +16,58 @@
16
16
  };
17
17
  }
18
18
 
19
+ let opener = null;
20
+
21
+ function open() {
22
+ const $main = $('.searchbox');
23
+ if (!$main.hasClass('show')) {
24
+ opener = document.activeElement;
25
+ $main.addClass('show');
26
+ }
27
+ $main.find('.searchbox-input').focus();
28
+ }
29
+
30
+ // Return the focus to the element that opened the search box, unless it moved elsewhere
31
+ function close(restoreFocus = true) {
32
+ $('.searchbox').removeClass('show');
33
+ if (restoreFocus && opener && document.contains(opener)) {
34
+ opener.focus();
35
+ }
36
+ opener = null;
37
+ }
38
+
39
+ // Open the search box with "/" (unless typing in a field) or Ctrl/Cmd+K
40
+ function isSearchShortcut(e) {
41
+ if (e.altKey) {
42
+ return false;
43
+ }
44
+ if (e.ctrlKey || e.metaKey) {
45
+ return !e.shiftKey && typeof e.key === 'string' && e.key.toLowerCase() === 'k';
46
+ }
47
+ // e.key is "/" whatever keys type it on the keyboard layout, so do not check e.shiftKey
48
+ const target = e.target;
49
+ const typing = target.isContentEditable || /^(input|textarea|select)$/i.test(target.tagName);
50
+ return e.key === '/' && !typing;
51
+ }
52
+
19
53
  $(document)
20
- .on('click', '.navbar-main .search', () => {
21
- $('.searchbox').toggleClass('show');
22
- })
23
- .on('click', '.searchbox .searchbox-mask', () => {
24
- $('.searchbox').removeClass('show');
54
+ .on('click', '.navbar-main .search', open)
55
+ .on('click', '.searchbox .searchbox-mask', () => close())
56
+ .on('click', '.searchbox-close', () => close())
57
+ .on('focusin', (e) => {
58
+ // Close the search box when the focus moves to the rest of the page, e.g., by Tab
59
+ const main = $('.searchbox')[0];
60
+ if (main && $(main).hasClass('show') && !main.contains(e.target)) {
61
+ close(false);
62
+ }
25
63
  })
26
- .on('click', '.searchbox-close', () => {
27
- $('.searchbox').removeClass('show');
64
+ .on('keydown', (e) => {
65
+ if (isSearchShortcut(e)) {
66
+ e.preventDefault();
67
+ open();
68
+ } else if (e.keyCode === 27 && $('.searchbox').hasClass('show')) {
69
+ close();
70
+ }
28
71
  })
29
72
  .on(
30
73
  'keydown',
@@ -87,7 +87,7 @@ function loadInsight(config, translation) {
87
87
 
88
88
  return `<a class="searchbox-result-item" href="${url}">
89
89
  <span class="searchbox-result-icon">
90
- <i class="fa fa-${icon}" />
90
+ <i class="fa fa-${icon}"></i>
91
91
  </span>
92
92
  <span class="searchbox-result-content">
93
93
  <span class="searchbox-result-title">
@@ -287,6 +287,39 @@ function loadInsight(config, translation) {
287
287
  scrollTo($($items[nextPosition]));
288
288
  }
289
289
 
290
+ let opener = null;
291
+
292
+ function open() {
293
+ if (!$main.hasClass('show')) {
294
+ opener = document.activeElement;
295
+ $main.addClass('show');
296
+ }
297
+ $input.focus();
298
+ }
299
+
300
+ // Return the focus to the element that opened the search box, unless it moved elsewhere
301
+ function close(restoreFocus = true) {
302
+ $main.removeClass('show');
303
+ if (restoreFocus && opener && document.contains(opener)) {
304
+ opener.focus();
305
+ }
306
+ opener = null;
307
+ }
308
+
309
+ // Open the search box with "/" (unless typing in a field) or Ctrl/Cmd+K
310
+ function isSearchShortcut(e) {
311
+ if (e.altKey) {
312
+ return false;
313
+ }
314
+ if (e.ctrlKey || e.metaKey) {
315
+ return !e.shiftKey && typeof e.key === 'string' && e.key.toLowerCase() === 'k';
316
+ }
317
+ // e.key is "/" whatever keys type it on the keyboard layout, so do not check e.shiftKey
318
+ const target = e.target;
319
+ const typing = target.isContentEditable || /^(input|textarea|select)$/i.test(target.tagName);
320
+ return e.key === '/' && !typing;
321
+ }
322
+
290
323
  function gotoLink($item) {
291
324
  if ($item && $item.length) {
292
325
  location.href = $item.attr('href');
@@ -306,10 +339,7 @@ function loadInsight(config, translation) {
306
339
 
307
340
  let touch = false;
308
341
  $(document)
309
- .on('click focus', '.navbar-main .search', () => {
310
- $main.addClass('show');
311
- $main.find('.searchbox-input').focus();
312
- })
342
+ .on('click', '.navbar-main .search', open)
313
343
  .on('click touchend', '.searchbox-result-item', function (e) {
314
344
  if (e.type !== 'click' && !touch) {
315
345
  return;
@@ -325,14 +355,25 @@ function loadInsight(config, translation) {
325
355
  setTimeout(() => {
326
356
  $('.navbar-main').css('pointer-events', 'auto');
327
357
  }, 400);
328
- $main.removeClass('show');
358
+ close();
329
359
  touch = false;
330
360
  })
361
+ .on('focusin', (e) => {
362
+ // Close the search box when the focus moves to the rest of the page, e.g., by Tab
363
+ if ($main.hasClass('show') && !$main[0].contains(e.target)) {
364
+ close(false);
365
+ }
366
+ })
331
367
  .on('keydown', (e) => {
368
+ if (isSearchShortcut(e)) {
369
+ e.preventDefault();
370
+ open();
371
+ return;
372
+ }
332
373
  if (!$main.hasClass('show')) return;
333
374
  switch (e.keyCode) {
334
375
  case 27: // ESC
335
- $main.removeClass('show');
376
+ close();
336
377
  break;
337
378
  case 38: // UP
338
379
  selectItemByDiff(-1);
@@ -36,8 +36,8 @@ const yaml = require('js-yaml');
36
36
  */
37
37
  module.exports = hexo => {
38
38
  const RESERVED_KEYS = {
39
- post: Object.keys(require('hexo/dist/models/post')(hexo).paths),
40
- page: Object.keys(require('hexo/dist/models/page')(hexo).paths)
39
+ post: Object.keys(hexo.model('Post').schema.paths),
40
+ page: Object.keys(hexo.model('Page').schema.paths)
41
41
  };
42
42
  function loadLayoutConfig(layout) {
43
43
  let config = {};
@@ -59,6 +59,11 @@ const UNPKG_FIXTURES = {
59
59
  * cdn('jquery', '3.3.1', 'dist/jquery.min.js');
60
60
  * // -> https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js
61
61
  *
62
+ * // Set providers.cdn_overrides, e.g., { jquery: 'unpkg' }, to use a different CDN provider or URL
63
+ * // template for some packages
64
+ * cdn('jquery', '3.3.1', 'dist/jquery.min.js');
65
+ * // -> https://unpkg.com/jquery@3.3.1/dist/jquery.min.js
66
+ *
62
67
  * // Use the function below to resolve the CDN URL web font files
63
68
  * fontcdn('Ubuntu:400,600|Source+Code+Pro', 'css');
64
69
  * // -> https://fonts.googleapis.com/css?family=Ubuntu:400,600|Source+Code+Pro
@@ -80,9 +85,12 @@ module.exports = function (hexo) {
80
85
  return [_package, version, filename];
81
86
  }
82
87
  hexo.extend.helper.register('cdn', function (_package, version, filename) {
88
+ const providers = typeof this.config.providers === 'object' ? this.config.providers : {};
83
89
  const {
84
- cdn = 'jsdelivr'
85
- } = typeof this.config.providers === 'object' ? this.config.providers : {};
90
+ cdn_overrides: overrides
91
+ } = providers;
92
+ // A package can use a different provider or URL than the rest in providers.cdn_overrides
93
+ const cdn = typeof overrides === 'object' && overrides !== null && overrides[_package] ? overrides[_package] : providers.cdn || 'jsdelivr';
86
94
  let _cdn = cdn;
87
95
  if (_cdn in PROVIDERS.LIBRARY) {
88
96
  _cdn = PROVIDERS.LIBRARY[_cdn];
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/artalk.json",
4
+ "description": "Artalk comment plugin configurations\nhttps://artalk.js.org/guide/frontend/config.html",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "artalk"
10
+ },
11
+ "server": {
12
+ "type": "string",
13
+ "description": "URL of your Artalk server"
14
+ },
15
+ "site": {
16
+ "type": "string",
17
+ "description": "Name of the site on the Artalk server",
18
+ "nullable": true
19
+ },
20
+ "page_key": {
21
+ "type": "string",
22
+ "description": "Unique identifier of the page. Uses the path of the page if not set",
23
+ "nullable": true
24
+ },
25
+ "locale": {
26
+ "type": "string",
27
+ "description": "Language of Artalk, e.g., en, zh-CN, or auto",
28
+ "nullable": true
29
+ },
30
+ "dark_mode": {
31
+ "type": ["boolean", "string"],
32
+ "description": "Dark mode: true, false, or 'auto' to follow the system color scheme. Follows the appearance of the theme (the data-appearance attribute of <html>) if not set",
33
+ "nullable": true
34
+ }
35
+ },
36
+ "required": ["type", "server"]
37
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/beaudar.json",
4
+ "description": "Beaudar comment plugin configurations\nhttps://github.com/beaudar/beaudar",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "beaudar"
10
+ },
11
+ "repo": {
12
+ "type": "string",
13
+ "description": "Name of the GitHub repository for the comments, e.g., user/repo"
14
+ },
15
+ "branch": {
16
+ "type": "string",
17
+ "description": "Branch of the repository that has beaudar.json",
18
+ "nullable": true
19
+ },
20
+ "label": {
21
+ "type": "string",
22
+ "description": "Label of the issues created by Beaudar",
23
+ "nullable": true
24
+ },
25
+ "theme": {
26
+ "type": "string",
27
+ "description": "Beaudar look and feel when the page looks light, e.g., github-light, github-dark, or preferred-color-scheme",
28
+ "default": "github-light",
29
+ "nullable": true
30
+ },
31
+ "dark_theme": {
32
+ "type": "string",
33
+ "description": "Beaudar look and feel when the page looks dark, e.g., with the dark or auto appearance of the theme. For example github-dark, github-dark-orange, classic-dark, dark-blue, icy-dark, or photon-dark",
34
+ "default": "github-dark",
35
+ "nullable": true
36
+ }
37
+ },
38
+ "required": ["type", "repo"],
39
+ "oneOf": [
40
+ {
41
+ "type": "object",
42
+ "properties": {
43
+ "issue_term": {
44
+ "type": "string",
45
+ "description": "The mapping between blog posts and GitHub issues, e.g., pathname, url, or title",
46
+ "default": "pathname"
47
+ }
48
+ },
49
+ "required": ["issue_term"]
50
+ },
51
+ {
52
+ "type": "object",
53
+ "properties": {
54
+ "issue_number": {
55
+ "type": "integer",
56
+ "description": "Configure Beaudar to load a specific issue by number"
57
+ }
58
+ },
59
+ "required": ["issue_number"]
60
+ }
61
+ ]
62
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/cusdis.json",
4
+ "description": "Cusdis comment plugin configurations\nhttps://cusdis.com/doc",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "cusdis"
10
+ },
11
+ "app_id": {
12
+ "type": "string",
13
+ "description": "App ID of the website in the embed code from the Cusdis dashboard"
14
+ },
15
+ "host": {
16
+ "type": "string",
17
+ "description": "URL of your Cusdis server if you host it yourself",
18
+ "default": "https://cusdis.com",
19
+ "nullable": true
20
+ },
21
+ "theme": {
22
+ "type": "string",
23
+ "description": "Theme of Cusdis: light, dark, or auto to follow the system color scheme. Follows the appearance of the theme (the data-appearance attribute of <html>) if not set",
24
+ "enum": ["light", "dark", "auto"],
25
+ "nullable": true
26
+ },
27
+ "lang": {
28
+ "type": "string",
29
+ "description": "Language of Cusdis, e.g., zh-cn, zh-tw, es, or fi. Uses English if not set",
30
+ "nullable": true
31
+ }
32
+ },
33
+ "required": ["type", "app_id"]
34
+ }
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "theme": {
62
62
  "type": "string",
63
- "description": "Giscus look and feel",
63
+ "description": "Giscus look and feel when the page looks light",
64
64
  "enum": [
65
65
  "light",
66
66
  "light_high_contrast",
@@ -83,6 +83,12 @@
83
83
  "default": "noborder_light",
84
84
  "nullable": true
85
85
  },
86
+ "darkTheme": {
87
+ "type": "string",
88
+ "description": "Giscus look and feel when the page looks dark, e.g., with the dark or auto appearance of the theme. Not used when theme is custom",
89
+ "default": "noborder_dark",
90
+ "nullable": true
91
+ },
86
92
  "customThemeCss": {
87
93
  "type": "string",
88
94
  "description": "The url of custom Giscus theme css, only affect when theme is set to custom",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "theme": {
21
21
  "type": "string",
22
- "description": "Utterances look and feel",
22
+ "description": "Utterances look and feel when the page looks light",
23
23
  "enum": [
24
24
  "github-light",
25
25
  "github-dark",
@@ -30,6 +30,20 @@
30
30
  ],
31
31
  "default": "github-light",
32
32
  "nullable": true
33
+ },
34
+ "dark_theme": {
35
+ "type": "string",
36
+ "description": "Utterances look and feel when the page looks dark, e.g., with the dark or auto appearance of the theme",
37
+ "enum": [
38
+ "github-light",
39
+ "github-dark",
40
+ "github-dark-orange",
41
+ "icy-dark",
42
+ "dark-blue",
43
+ "photon-dark"
44
+ ],
45
+ "default": "github-dark",
46
+ "nullable": true
33
47
  }
34
48
  },
35
49
  "required": ["type", "repo"],
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "/comment/valine.json",
4
- "description": "Valine comment plugin configurations",
4
+ "description": "Valine comment plugin configurations\nWARNING: Valine saves comments, including the commenters' email addresses, in a LeanCloud class that anyone with your public app ID and key can read. Consider Waline or another comment system instead.",
5
5
  "type": "object",
6
6
  "properties": {
7
7
  "type": {
@@ -69,7 +69,7 @@
69
69
  },
70
70
  "record_ip": {
71
71
  "type": "boolean",
72
- "description": "Record reviewer IP address",
72
+ "description": "Record reviewer IP address. The IP addresses can be read by anyone, like the email addresses",
73
73
  "default": false,
74
74
  "nullable": true
75
75
  },
@@ -77,7 +77,7 @@
77
77
  },
78
78
  "dark": {
79
79
  "type": ["string", "boolean"],
80
- "description": "Darkmode support.",
80
+ "description": "Darkmode support. Can be true, false, 'auto' to follow the system color scheme, or a CSS selector that enables the dark mode when it matches an ancestor of Waline. Follows the appearance of the theme (the data-appearance attribute of <html>) if not set",
81
81
  "nullable": true
82
82
  },
83
83
  "meta": {
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/plugin/matomo.json",
4
+ "description": "Matomo analytics plugin settings\nhttps://matomo.org",
5
+ "type": "object",
6
+ "properties": {
7
+ "url": {
8
+ "type": "string",
9
+ "description": "URL of your Matomo server, e.g., https://matomo.example.com/ or https://example.matomo.cloud/",
10
+ "nullable": true
11
+ },
12
+ "site_id": {
13
+ "type": ["string", "number"],
14
+ "description": "Matomo site ID",
15
+ "nullable": true
16
+ },
17
+ "disable_cookies": {
18
+ "type": "boolean",
19
+ "description": "Track visitors without setting cookies",
20
+ "default": false,
21
+ "nullable": true
22
+ }
23
+ },
24
+ "required": ["url", "site_id"]
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/plugin/umami.json",
4
+ "description": "Umami analytics plugin settings\nhttps://umami.is/docs/tracker-configuration",
5
+ "type": "object",
6
+ "properties": {
7
+ "website_id": {
8
+ "type": "string",
9
+ "description": "Umami website ID",
10
+ "nullable": true
11
+ },
12
+ "script_url": {
13
+ "type": "string",
14
+ "description": "URL of the Umami tracker script. Change it to the one on your server if you host Umami yourself",
15
+ "default": "https://cloud.umami.is/script.js",
16
+ "nullable": true
17
+ },
18
+ "domains": {
19
+ "type": "string",
20
+ "description": "Only track the visits on these comma-separated domains",
21
+ "nullable": true
22
+ }
23
+ },
24
+ "required": ["website_id"]
25
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/plugin/waline_pageview.json",
4
+ "description": "Waline page view counter, true to use the server of the Waline comments, which can also store the views in LeanCloud. Do not also enable the pageview option of the Waline comments, which would count the views twice\nhttps://waline.js.org/en/guide/features/pageview.html",
5
+ "type": ["boolean", "object"],
6
+ "properties": {
7
+ "server_url": {
8
+ "type": "string",
9
+ "description": "URL of the Waline server. Uses the server of the Waline comments if not set",
10
+ "nullable": true
11
+ }
12
+ },
13
+ "default": false
14
+ }
@@ -7,6 +7,10 @@
7
7
  "type": {
8
8
  "type": "string",
9
9
  "const": "algolia"
10
+ },
11
+ "excerpt": {
12
+ "type": "string",
13
+ "description": "The field name to be used as the excerpt in the Algolia index. Defaults to 'excerpt'."
10
14
  }
11
15
  },
12
16
  "required": ["type"]
@@ -7,6 +7,11 @@
7
7
  "type": {
8
8
  "type": "string",
9
9
  "const": "archives"
10
+ },
11
+ "amount": {
12
+ "type": "integer",
13
+ "description": "Amount of archives to show, with a link to the archive page for the rest. Will show all if not set",
14
+ "nullable": true
10
15
  }
11
16
  },
12
17
  "required": ["type"]
@@ -7,6 +7,11 @@
7
7
  "type": {
8
8
  "type": "string",
9
9
  "const": "categories"
10
+ },
11
+ "amount": {
12
+ "type": "integer",
13
+ "description": "Amount of top-level categories to show, with a link to the category page for the rest. Will show all if not set",
14
+ "nullable": true
10
15
  }
11
16
  },
12
17
  "required": ["type"]
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "amount": {
18
18
  "type": "integer",
19
- "description": "Amount of tags to show. Will show all if not set.",
19
+ "description": "Amount of tags to show, with a link to the tag page for the rest. Will show all if not set.",
20
20
  "nullable": true
21
21
  },
22
22
  "show_count": {
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Utility functions for inline scripts that follow the appearance of the page.
3
+ * @module util/appearance
4
+ */
5
+
6
+ /**
7
+ * Get a JavaScript expression that is true when the page looks dark.
8
+ * <p>
9
+ * A theme can set the appearance of a page with the <code>data-appearance</code> attribute of
10
+ * <code>&lt;html&gt;</code>: <code>dark</code> always looks dark, <code>auto</code> looks dark when
11
+ * the system prefers a dark color scheme, and any other value, or no attribute, looks light.
12
+ *
13
+ * @returns {string} The JavaScript expression.
14
+ *
15
+ * @example
16
+ * const js = `var theme = ${isDark()} ? 'dark' : 'light';`;
17
+ */
18
+ function isDark() {
19
+ return `(function (appearance) {
20
+ return appearance === 'dark' || (appearance === 'auto' && !!window.matchMedia &&
21
+ window.matchMedia('(prefers-color-scheme: dark)').matches);
22
+ })(document.documentElement.getAttribute('data-appearance'))`;
23
+ }
24
+
25
+ /**
26
+ * Get a JavaScript expression for the appearance of the page: <code>'dark'</code>,
27
+ * <code>'auto'</code>, or <code>'light'</code>.
28
+ *
29
+ * @returns {string} The JavaScript expression.
30
+ * @see module:util/appearance.isDark
31
+ */
32
+ function getAppearance() {
33
+ return `(function (appearance) {
34
+ return appearance === 'dark' || appearance === 'auto' ? appearance : 'light';
35
+ })(document.documentElement.getAttribute('data-appearance'))`;
36
+ }
37
+ module.exports = {
38
+ isDark,
39
+ getAppearance
40
+ };