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
@@ -1,19 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/plugin/cnzz.json",
4
- "description": "CNZZ statistics\nhttps://www.umeng.com/web",
5
- "type": "object",
6
- "properties": {
7
- "id": {
8
- "type": ["string", "number"],
9
- "description": "CNZZ tracker id",
10
- "nullable": true
11
- },
12
- "web_id": {
13
- "type": ["string", "number"],
14
- "description": "CNZZ website id",
15
- "nullable": true
16
- }
17
- },
18
- "required": ["id", "web_id"]
19
- }
@@ -1,38 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/plugin/cookie_consent.json",
4
- "description": "Alerting users about the use of cookies\nhttps://www.osano.com/cookieconsent/",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "description": "The compliance type. Can be \"info\", \"opt-in\", or \"opt-out\"",
10
- "default": "info",
11
- "nullable": true
12
- },
13
- "theme": {
14
- "type": "string",
15
- "description": "Theme of the popup. Can be \"block\", \"edgeless\", or \"classic\"",
16
- "default": "edgeless",
17
- "nullable": true
18
- },
19
- "static": {
20
- "type": "boolean",
21
- "description": "Whether the popup should stay static regardless of the page scrolls",
22
- "default": false,
23
- "nullable": true
24
- },
25
- "position": {
26
- "type": "string",
27
- "description": "Where on the screen the consent popup should display",
28
- "default": "bottom-left",
29
- "nullable": true
30
- },
31
- "policyLink": {
32
- "type": "string",
33
- "description": "URL to your site's cookie policy",
34
- "default": "https://www.cookiesandyou.com/",
35
- "nullable": true
36
- }
37
- }
38
- }
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/plugin/gallery.json",
4
- "description": "Enable the lightGallery and Justified Gallery plugins",
5
- "type": "boolean",
6
- "default": true
7
- }
@@ -1,14 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/plugin/google_analytics.json",
4
- "description": "Google Analytics plugin settings\nhttps://analytics.google.com",
5
- "type": "object",
6
- "properties": {
7
- "tracking_id": {
8
- "type": "string",
9
- "description": "Google Analytics tracking ID",
10
- "nullable": true
11
- }
12
- },
13
- "required": ["tracking_id"]
14
- }
@@ -1,14 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/plugin/hotjar.json",
4
- "description": "Hotjar user feedback plugin\nhttps://www.hotjar.com/",
5
- "type": "object",
6
- "properties": {
7
- "site_id": {
8
- "type": ["string", "number"],
9
- "description": "Hotjar site id",
10
- "nullable": true
11
- }
12
- },
13
- "required": ["site_id"]
14
- }
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/plugin/katex.json",
4
- "description": "Enable the KaTeX math typesetting support\nhttps://katex.org/",
5
- "type": "boolean",
6
- "default": false
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/plugin/mathjax.json",
4
- "description": "Enable the MathJax math typesetting support\nhttps://www.mathjax.org/",
5
- "type": "boolean",
6
- "default": false
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/plugin/outdated_browser.json",
4
- "description": "Enable the Outdated Browser plugin\nhttp://outdatedbrowser.com/",
5
- "type": "boolean",
6
- "default": false
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/plugin/progressbar.json",
4
- "description": "Show a progress bar at top of the page on page loading",
5
- "type": "boolean",
6
- "default": true
7
- }
@@ -1,19 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/plugin/statcounter.json",
4
- "description": "Statcounter statistics\nhttps://statcounter.com/",
5
- "type": "object",
6
- "properties": {
7
- "project": {
8
- "type": ["string", "number"],
9
- "description": "Statcounter project id",
10
- "nullable": true
11
- },
12
- "security": {
13
- "type": ["string", "number"],
14
- "description": "Statcounter project security code",
15
- "nullable": true
16
- }
17
- },
18
- "required": ["project", "security"]
19
- }
@@ -1,14 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/plugin/twitter_conversion_tracking.json",
4
- "description": "Twitter conversion tracking plugin settings\nhttps://business.twitter.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites.html",
5
- "type": "object",
6
- "properties": {
7
- "pixel_id": {
8
- "type": "string",
9
- "description": "Twitter Pixel ID",
10
- "nullable": true
11
- }
12
- },
13
- "required": ["pixel_id"]
14
- }
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/search/algolia.json",
4
- "description": "Enable Algolia search\nhttps://www.algolia.com",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "algolia"
10
- }
11
- },
12
- "required": ["type"]
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/search/baidu.json",
4
- "description": "Enable Baidu search",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "baidu"
10
- }
11
- },
12
- "required": ["type"]
13
- }
@@ -1,17 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/search/google_cse.json",
4
- "description": "Enable Google CSE\nhttps://cse.google.com/cse/create/new",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "google_cse"
10
- },
11
- "cx": {
12
- "type": "string",
13
- "description": "Google CSE cx value"
14
- }
15
- },
16
- "required": ["type", "cx"]
17
- }
@@ -1,19 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/search/insight.json",
4
- "description": "Enable Insight search",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "insight"
10
- },
11
- "index_pages": {
12
- "type": "boolean",
13
- "description": "Whether to include pages in the search results",
14
- "default": true,
15
- "nullable": true
16
- }
17
- },
18
- "required": ["type"]
19
- }
@@ -1,17 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/share/addthis.json",
4
- "description": "Enable AddThis share buttons\nhttps://www.addthis.com/",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "addthis"
10
- },
11
- "install_url": {
12
- "type": "string",
13
- "description": "URL to the AddThis share plugin script"
14
- }
15
- },
16
- "required": ["type", "install_url"]
17
- }
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/share/addtoany.json",
4
- "description": "Enable AddToAny share buttons\nhttps://www.addtoany.com/",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "addtoany"
10
- }
11
- },
12
- "required": ["type"]
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/share/bdshare.json",
4
- "description": "Enable Baidu share buttons",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "bdshare"
10
- }
11
- },
12
- "required": ["type"]
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/share/sharejs.json",
4
- "description": "Enable Share.js share buttons\nhttps://github.com/overtrue/share.js/",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "sharejs"
10
- }
11
- },
12
- "required": ["type"]
13
- }
@@ -1,17 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/share/sharethis.json",
4
- "description": "Enable ShareThis share buttons\nhttps://sharethis.com/",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "sharethis"
10
- },
11
- "install_url": {
12
- "type": "string",
13
- "description": "URL to the ShareThis share plugin script"
14
- }
15
- },
16
- "required": ["type", "install_url"]
17
- }
@@ -1,21 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/widget/adsense.json",
4
- "description": "Google AdSense unit configurations",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "adsense"
10
- },
11
- "client_id": {
12
- "type": "string",
13
- "description": "AdSense client ID"
14
- },
15
- "slot_id": {
16
- "type": "string",
17
- "description": "AdSense AD unit ID"
18
- }
19
- },
20
- "required": ["type", "client_id", "slot_id"]
21
- }
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/widget/archives.json",
4
- "description": "Archives widget configurations",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "archives"
10
- }
11
- },
12
- "required": ["type"]
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/widget/categories.json",
4
- "description": "Categories widget configurations",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "categories"
10
- }
11
- },
12
- "required": ["type"]
13
- }
@@ -1,26 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/widget/followit.json",
4
- "description": "Follow.it email subscription widget configurations",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "followit"
10
- },
11
- "description": {
12
- "type": "string",
13
- "description": "Hint text under the email input",
14
- "nullable": true
15
- },
16
- "action_url": {
17
- "type": "string",
18
- "description": "Subscription form action URL"
19
- },
20
- "verification_code": {
21
- "type": "string",
22
- "description": "Feed claiming verification code"
23
- }
24
- },
25
- "required": ["type", "action_url", "verification_code"]
26
- }
@@ -1,47 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/widget/links.json",
4
- "description": "Recommendation links widget configurations",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "links"
10
- },
11
- "links": {
12
- "type": "object",
13
- "description": "Names and URLs of the sites",
14
- "patternProperties": {
15
- ".+": {
16
- "anyOf": [
17
- {
18
- "type": "string",
19
- "description": "URL of the site"
20
- },
21
- {
22
- "type": "object",
23
- "properties": {
24
- "link": {
25
- "type": "string",
26
- "description": "URL of the site"
27
- },
28
- "hide_hostname": {
29
- "type": "boolean",
30
- "description": "Whether remove righthand hostname tag from the menu"
31
- }
32
- }
33
- }
34
- ]
35
- }
36
- },
37
- "examples": [
38
- {
39
- "Hexo": "https://hexo.io",
40
- "Bulma": "https://bulma.io"
41
- }
42
- ],
43
- "nullable": true
44
- }
45
- },
46
- "required": ["type"]
47
- }
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/widget/recent_posts.json",
4
- "description": "Recent posts widget configurations",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "recent_posts"
10
- }
11
- },
12
- "required": ["type"]
13
- }
@@ -1,22 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/widget/subscribe_email.json",
4
- "description": "Google FeedBurner email subscription widget configurations",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "subscribe_email"
10
- },
11
- "description": {
12
- "type": "string",
13
- "description": "Hint text under the email input",
14
- "nullable": true
15
- },
16
- "feedburner_id": {
17
- "type": "string",
18
- "description": "Feedburner ID"
19
- }
20
- },
21
- "required": ["type", "feedburner_id"]
22
- }
@@ -1,30 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/widget/tags.json",
4
- "description": "Tags widget configurations",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "tags"
10
- },
11
- "order_by": {
12
- "type": "string",
13
- "default": "name",
14
- "description": "How to order tags. For example 'name' to order by name in ascending order, and '-length' to order by number of posts in each tags in descending order",
15
- "nullable": true
16
- },
17
- "amount": {
18
- "type": "integer",
19
- "description": "Amount of tags to show. Will show all if not set.",
20
- "nullable": true
21
- },
22
- "show_count": {
23
- "type": "boolean",
24
- "default": true,
25
- "description": "Whether to show tags count, i.e. number of posts in the tag.",
26
- "nullable": true
27
- }
28
- },
29
- "required": ["type"]
30
- }
@@ -1,31 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "/widget/toc.json",
4
- "description": "Table of contents widget configurations",
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "toc"
10
- },
11
- "index": {
12
- "type": "boolean",
13
- "description": "Whether to show the index of each heading",
14
- "default": true,
15
- "nullable": true
16
- },
17
- "collapsed": {
18
- "type": "boolean",
19
- "description": "Whether to collapse sub-headings when they are out-of-view",
20
- "default": true,
21
- "nullable": true
22
- },
23
- "depth": {
24
- "type": "integer",
25
- "description": "Maximum level of headings to show (1-6)",
26
- "default": 3,
27
- "nullable": true
28
- }
29
- },
30
- "required": ["type"]
31
- }
@@ -1,24 +0,0 @@
1
- const {
2
- renderToStaticMarkup
3
- } = require('inferno-server');
4
- const {
5
- createElement
6
- } = require('inferno-create-element');
7
- const {
8
- cacheComponent
9
- } = require('../util/cache');
10
- const Example = require('../../fixture/layout/example');
11
- test('The cached component can be successfully rendered', () => {
12
- const props = {
13
- subject: 'world'
14
- };
15
- const html = renderToStaticMarkup(createElement(Example, props));
16
- const CacheableExample = cacheComponent(Example, 'example', p => p);
17
- let htmlCached = renderToStaticMarkup(createElement(CacheableExample, props));
18
- expect(htmlCached).toBe(html);
19
- htmlCached = renderToStaticMarkup(createElement(CacheableExample, props));
20
- expect(htmlCached).toBe(html);
21
- const InvalidExample = cacheComponent(Example, 'example', p => null);
22
- htmlCached = renderToStaticMarkup(createElement(InvalidExample, props));
23
- expect(htmlCached).toBe('<!--!-->');
24
- });
@@ -1,13 +0,0 @@
1
- const classname = require('../util/classname');
2
- test('Correctly create the class name string', () => {
3
- expect(classname('class-1')).toBe('class-1');
4
- expect(classname(['class-1', 'class-2'])).toBe('class-1 class-2');
5
- expect(classname({
6
- 'class-1': true,
7
- 'class-2': false,
8
- 'class-3': 1
9
- })).toBe('class-1 class-3');
10
- expect(() => {
11
- return classname(false);
12
- }).toThrow();
13
- });
@@ -1,18 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const yaml = require('../util/yaml');
4
- test('Correctly parse YAML string', () => {
5
- const example = fs.readFileSync(path.join(__dirname, '../../fixture/misc/original.yaml'), {
6
- encoding: 'utf8'
7
- });
8
- const result = JSON.stringify(yaml.parse(example));
9
- const expected = JSON.stringify(require('../../fixture/misc/parsed.json'));
10
- expect(result).toEqual(expected);
11
- });
12
- test('Correctly format to YAML string', () => {
13
- const example = require('../../fixture/misc/parsed.json');
14
- const expected = fs.readFileSync(path.join(__dirname, '../../fixture/misc/stringified.yaml'), {
15
- encoding: 'utf8'
16
- });
17
- expect(yaml.stringify(example)).toBe(expected);
18
- });
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- var _inferno = require("inferno");
4
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
9
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
- var Toc = require('./toc');
11
- var _require = require('inferno-test-utils'),
12
- renderIntoContainer = _require.renderIntoContainer,
13
- scryRenderedDOMElementsWithClass = _require.scryRenderedDOMElementsWithClass;
14
- function createTocAndGetLevels(content) {
15
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
16
- var widget = renderIntoContainer((0, _inferno.normalizeProps)((0, _inferno.createComponentVNode)(2, Toc, _objectSpread({
17
- "content": content
18
- }, options))));
19
- return scryRenderedDOMElementsWithClass(widget, 'level-item').map(function (item) {
20
- return item.innerHTML;
21
- });
22
- }
23
- test('Correctly render headings', function () {
24
- var levels = createTocAndGetLevels("\n <h1>Title 1</h1>\n <h2>Title 1.1</h2>\n <h3>Title 1.1.1</h3>\n <h3>Title 1.1.2</h3>\n <h2>Title 1.2</h2>\n <h3>Title 1.2.1</h3>\n <h3>Title 1.2.2</h3>\n <h1>Title 2</h1>\n <h2>Title 2.1</h2>\n <h2>Title 2.2</h2>\n <h3>Title 2.2.1</h3>\n <h3>Title 2.2.2</h3>\n ");
25
- expect(levels).toEqual(['1', 'Title 1', '1.1', 'Title 1.1', '1.1.1', 'Title 1.1.1', '1.1.2', 'Title 1.1.2', '1.2', 'Title 1.2', '1.2.1', 'Title 1.2.1', '1.2.2', 'Title 1.2.2', '2', 'Title 2', '2.1', 'Title 2.1', '2.2', 'Title 2.2', '2.2.1', 'Title 2.2.1', '2.2.2', 'Title 2.2.2']);
26
- });
27
- test('Correctly render disjunct levels of heading', function () {
28
- var levels = createTocAndGetLevels("\n <h2>Title 1</h2>\n <h2>Title 2</h2>\n <h4>Title 2.1</h4>\n <h4>Title 2.2</h4>\n <h4>Title 2.3</h4>\n <h2>Title 3</h2>\n ");
29
- expect(levels).toEqual(['1', 'Title 1', '2', 'Title 2', '2.1', 'Title 2.1', '2.2', 'Title 2.2', '2.3', 'Title 2.3', '3', 'Title 3']);
30
- });