hexo-component-inferno 3.1.2 → 4.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.
- package/asset/js/algolia.js +51 -10
- package/asset/js/google_cse.js +50 -7
- package/asset/js/insight.js +48 -7
- package/lib/hexo/filter/locals.js +2 -2
- package/lib/schema/comment/valine.json +2 -2
- package/lib/schema/plugin/matomo.json +25 -0
- package/lib/schema/plugin/umami.json +25 -0
- package/lib/schema/search/algolia.json +4 -0
- package/lib/util/script.js +65 -0
- package/lib/view/comment/changyan.js +5 -5
- package/lib/view/comment/disqus.js +1 -1
- package/lib/view/comment/disqusjs.js +6 -5
- package/lib/view/comment/facebook.js +1 -1
- package/lib/view/comment/giscus.js +1 -1
- package/lib/view/comment/gitalk.js +6 -5
- package/lib/view/comment/gitment.js +6 -5
- package/lib/view/comment/isso.js +7 -3
- package/lib/view/comment/livere.js +1 -1
- package/lib/view/comment/twikoo.js +3 -4
- package/lib/view/comment/utterances.js +1 -1
- package/lib/view/comment/valine.js +3 -6
- package/lib/view/comment/waline.js +8 -7
- package/lib/view/common/article_media.js +2 -2
- package/lib/view/donate/afdian.js +1 -1
- package/lib/view/donate/alipay.js +1 -1
- package/lib/view/donate/buymeacoffee.js +1 -1
- package/lib/view/donate/patreon.js +1 -1
- package/lib/view/donate/paypal.js +1 -1
- package/lib/view/donate/wechat.js +1 -1
- package/lib/view/misc/article_licensing.js +1 -1
- package/lib/view/misc/meta.js +1 -1
- package/lib/view/misc/open_graph.js +1 -1
- package/lib/view/misc/paginator.js +9 -5
- package/lib/view/misc/structured_data.js +1 -1
- package/lib/view/misc/web_app.js +2 -2
- package/lib/view/plugin/baidu_analytics.js +1 -1
- package/lib/view/plugin/bing_webmaster.js +1 -1
- package/lib/view/plugin/busuanzi.js +1 -1
- package/lib/view/plugin/cnzz.js +1 -1
- package/lib/view/plugin/cookie_consent.js +1 -1
- package/lib/view/plugin/gallery.js +2 -2
- package/lib/view/plugin/google_analytics.js +1 -1
- package/lib/view/plugin/hotjar.js +1 -1
- package/lib/view/plugin/katex.js +1 -1
- package/lib/view/plugin/mathjax.js +1 -1
- package/lib/view/plugin/matomo.js +89 -0
- package/lib/view/plugin/outdated_browser.js +1 -1
- package/lib/view/plugin/progressbar.js +1 -1
- package/lib/view/plugin/statcounter.js +1 -1
- package/lib/view/plugin/twitter_conversion_tracking.js +1 -1
- package/lib/view/plugin/umami.js +88 -0
- package/lib/view/search/algolia.js +11 -5
- package/lib/view/search/baidu.js +5 -3
- package/lib/view/search/google_cse.js +4 -2
- package/lib/view/search/insight.js +1 -1
- package/lib/view/share/addthis.js +1 -1
- package/lib/view/share/addtoany.js +1 -1
- package/lib/view/share/bdshare.js +1 -1
- package/lib/view/share/sharejs.js +1 -1
- package/lib/view/share/sharethis.js +1 -1
- package/lib/view/widget/adsense.js +1 -1
- package/lib/view/widget/archives.js +23 -5
- package/lib/view/widget/categories.js +1 -1
- package/lib/view/widget/followit.js +1 -1
- package/lib/view/widget/links.js +1 -1
- package/lib/view/widget/recent_posts.js +1 -1
- package/lib/view/widget/subscribe_email.js +1 -1
- package/lib/view/widget/tags.js +1 -1
- package/lib/view/widget/toc.js +1 -1
- package/package.json +10 -5
- package/lib/core/migrate.test.js +0 -48
- package/lib/core/schema.test.js +0 -520
- package/lib/core/view.test.js +0 -41
- package/lib/hexo/filter/locals.test.js +0 -118
- package/lib/hexo/generator/assets.test.js +0 -32
- package/lib/hexo/generator/categories.test.js +0 -41
- package/lib/hexo/generator/category.test.js +0 -84
- package/lib/hexo/generator/insight.test.js +0 -95
- package/lib/hexo/generator/manifest.test.js +0 -52
- package/lib/hexo/generator/tags.test.js +0 -41
- package/lib/hexo/helper/cdn.test.js +0 -128
- package/lib/hexo/helper/page.test.js +0 -62
- package/lib/hexo/tag/message.test.js +0 -72
- package/lib/hexo/tag/tabs.test.js +0 -98
- package/lib/schema/schema/comment/changyan.json +0 -21
- package/lib/schema/schema/comment/disqus.json +0 -17
- package/lib/schema/schema/comment/disqusjs.json +0 -53
- package/lib/schema/schema/comment/facebook.json +0 -13
- package/lib/schema/schema/comment/giscus.json +0 -105
- package/lib/schema/schema/comment/gitalk.json +0 -81
- package/lib/schema/schema/comment/gitment.json +0 -47
- package/lib/schema/schema/comment/isso.json +0 -17
- package/lib/schema/schema/comment/livere.json +0 -17
- package/lib/schema/schema/comment/twikoo.json +0 -28
- package/lib/schema/schema/comment/utterances.json +0 -59
- package/lib/schema/schema/comment/valine.json +0 -105
- package/lib/schema/schema/comment/waline.json +0 -176
- package/lib/schema/schema/donate/afdian.json +0 -17
- package/lib/schema/schema/donate/alipay.json +0 -17
- package/lib/schema/schema/donate/buymeacoffee.json +0 -17
- package/lib/schema/schema/donate/patreon.json +0 -17
- package/lib/schema/schema/donate/paypal.json +0 -22
- package/lib/schema/schema/donate/wechat.json +0 -17
- package/lib/schema/schema/misc/manifest.json +0 -66
- package/lib/schema/schema/misc/meta.json +0 -11
- package/lib/schema/schema/misc/open_graph.json +0 -78
- package/lib/schema/schema/misc/poly_links.json +0 -35
- package/lib/schema/schema/misc/structured_data.json +0 -47
- package/lib/schema/schema/plugin/baidu_analytics.json +0 -14
- package/lib/schema/schema/plugin/bing_webmaster.json +0 -14
- package/lib/schema/schema/plugin/busuanzi.json +0 -7
- package/lib/schema/schema/plugin/cnzz.json +0 -19
- package/lib/schema/schema/plugin/cookie_consent.json +0 -38
- package/lib/schema/schema/plugin/gallery.json +0 -7
- package/lib/schema/schema/plugin/google_analytics.json +0 -14
- package/lib/schema/schema/plugin/hotjar.json +0 -14
- package/lib/schema/schema/plugin/katex.json +0 -7
- package/lib/schema/schema/plugin/mathjax.json +0 -7
- package/lib/schema/schema/plugin/outdated_browser.json +0 -7
- package/lib/schema/schema/plugin/progressbar.json +0 -7
- package/lib/schema/schema/plugin/statcounter.json +0 -19
- package/lib/schema/schema/plugin/twitter_conversion_tracking.json +0 -14
- package/lib/schema/schema/search/algolia.json +0 -13
- package/lib/schema/schema/search/baidu.json +0 -13
- package/lib/schema/schema/search/google_cse.json +0 -17
- package/lib/schema/schema/search/insight.json +0 -19
- package/lib/schema/schema/share/addthis.json +0 -17
- package/lib/schema/schema/share/addtoany.json +0 -13
- package/lib/schema/schema/share/bdshare.json +0 -13
- package/lib/schema/schema/share/sharejs.json +0 -13
- package/lib/schema/schema/share/sharethis.json +0 -17
- package/lib/schema/schema/widget/adsense.json +0 -21
- package/lib/schema/schema/widget/archives.json +0 -13
- package/lib/schema/schema/widget/categories.json +0 -13
- package/lib/schema/schema/widget/followit.json +0 -26
- package/lib/schema/schema/widget/links.json +0 -47
- package/lib/schema/schema/widget/recent_posts.json +0 -13
- package/lib/schema/schema/widget/subscribe_email.json +0 -22
- package/lib/schema/schema/widget/tags.json +0 -30
- package/lib/schema/schema/widget/toc.json +0 -31
- package/lib/util/cache.test.js +0 -24
- package/lib/util/classname.test.js +0 -13
- package/lib/util/yaml.test.js +0 -18
- 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/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
|
-
}
|
package/lib/util/cache.test.js
DELETED
|
@@ -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
|
-
});
|
package/lib/util/yaml.test.js
DELETED
|
@@ -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
|
-
});
|