hexo-component-inferno 1.1.0 → 1.2.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 (119) hide show
  1. package/lib/hexo/generator/insight.js +8 -1
  2. package/lib/hexo/generator/insight.test.js +16 -0
  3. package/lib/hexo/tag/message.test.js +2 -2
  4. package/lib/hexo/tag/tabs.test.js +3 -3
  5. package/lib/schema/comment/twikoo.json +17 -0
  6. package/lib/schema/schema/comment/changyan.json +21 -0
  7. package/lib/schema/schema/comment/disqus.json +17 -0
  8. package/lib/schema/schema/comment/disqusjs.json +53 -0
  9. package/lib/schema/schema/comment/facebook.json +13 -0
  10. package/lib/schema/schema/comment/gitalk.json +81 -0
  11. package/lib/schema/schema/comment/gitment.json +47 -0
  12. package/lib/schema/schema/comment/isso.json +17 -0
  13. package/lib/schema/schema/comment/livere.json +17 -0
  14. package/lib/schema/schema/comment/twikoo.json +17 -0
  15. package/lib/schema/schema/comment/utterances.json +59 -0
  16. package/lib/schema/schema/comment/valine.json +105 -0
  17. package/lib/schema/schema/comment/waline.json +164 -0
  18. package/lib/schema/schema/donate/afdian.json +17 -0
  19. package/lib/schema/schema/donate/alipay.json +17 -0
  20. package/lib/schema/schema/donate/buymeacoffee.json +17 -0
  21. package/lib/schema/schema/donate/patreon.json +17 -0
  22. package/lib/schema/schema/donate/paypal.json +22 -0
  23. package/lib/schema/schema/donate/wechat.json +17 -0
  24. package/lib/schema/schema/misc/manifest.json +66 -0
  25. package/lib/schema/schema/misc/meta.json +11 -0
  26. package/lib/schema/schema/misc/open_graph.json +78 -0
  27. package/lib/schema/schema/misc/poly_links.json +35 -0
  28. package/lib/schema/schema/misc/structured_data.json +47 -0
  29. package/lib/schema/schema/plugin/baidu_analytics.json +14 -0
  30. package/lib/schema/schema/plugin/bing_webmaster.json +14 -0
  31. package/lib/schema/schema/plugin/busuanzi.json +7 -0
  32. package/lib/schema/schema/plugin/cnzz.json +19 -0
  33. package/lib/schema/schema/plugin/cookie_consent.json +38 -0
  34. package/lib/schema/schema/plugin/gallery.json +7 -0
  35. package/lib/schema/schema/plugin/google_analytics.json +14 -0
  36. package/lib/schema/schema/plugin/hotjar.json +14 -0
  37. package/lib/schema/schema/plugin/katex.json +7 -0
  38. package/lib/schema/schema/plugin/mathjax.json +7 -0
  39. package/lib/schema/schema/plugin/outdated_browser.json +7 -0
  40. package/lib/schema/schema/plugin/progressbar.json +7 -0
  41. package/lib/schema/schema/plugin/statcounter.json +19 -0
  42. package/lib/schema/schema/plugin/twitter_conversion_tracking.json +14 -0
  43. package/lib/schema/schema/search/algolia.json +13 -0
  44. package/lib/schema/schema/search/baidu.json +13 -0
  45. package/lib/schema/schema/search/google_cse.json +17 -0
  46. package/lib/schema/schema/search/insight.json +13 -0
  47. package/lib/schema/schema/share/addthis.json +17 -0
  48. package/lib/schema/schema/share/addtoany.json +13 -0
  49. package/lib/schema/schema/share/bdshare.json +13 -0
  50. package/lib/schema/schema/share/sharejs.json +13 -0
  51. package/lib/schema/schema/share/sharethis.json +17 -0
  52. package/lib/schema/schema/widget/adsense.json +21 -0
  53. package/lib/schema/schema/widget/archives.json +13 -0
  54. package/lib/schema/schema/widget/categories.json +13 -0
  55. package/lib/schema/schema/widget/followit.json +26 -0
  56. package/lib/schema/schema/widget/links.json +47 -0
  57. package/lib/schema/schema/widget/recent_posts.json +13 -0
  58. package/lib/schema/schema/widget/subscribe_email.json +22 -0
  59. package/lib/schema/schema/widget/tags.json +30 -0
  60. package/lib/schema/schema/widget/toc.json +31 -0
  61. package/lib/schema/widget/tags.json +17 -0
  62. package/lib/view/comment/changyan.js +2 -2
  63. package/lib/view/comment/disqus.js +2 -2
  64. package/lib/view/comment/disqusjs.js +2 -2
  65. package/lib/view/comment/facebook.js +2 -2
  66. package/lib/view/comment/gitalk.js +2 -2
  67. package/lib/view/comment/gitment.js +2 -2
  68. package/lib/view/comment/isso.js +2 -2
  69. package/lib/view/comment/livere.js +2 -2
  70. package/lib/view/comment/twikoo.js +102 -0
  71. package/lib/view/comment/utterances.js +2 -2
  72. package/lib/view/comment/valine.js +2 -2
  73. package/lib/view/comment/waline.js +2 -2
  74. package/lib/view/common/article_media.js +2 -2
  75. package/lib/view/donate/afdian.js +2 -2
  76. package/lib/view/donate/alipay.js +2 -2
  77. package/lib/view/donate/buymeacoffee.js +2 -2
  78. package/lib/view/donate/patreon.js +2 -2
  79. package/lib/view/donate/paypal.js +2 -2
  80. package/lib/view/donate/wechat.js +2 -2
  81. package/lib/view/misc/article_licensing.js +2 -2
  82. package/lib/view/misc/meta.js +2 -2
  83. package/lib/view/misc/open_graph.js +12 -4
  84. package/lib/view/misc/paginator.js +2 -2
  85. package/lib/view/misc/structured_data.js +2 -2
  86. package/lib/view/misc/web_app.js +2 -2
  87. package/lib/view/plugin/baidu_analytics.js +2 -2
  88. package/lib/view/plugin/bing_webmaster.js +2 -2
  89. package/lib/view/plugin/busuanzi.js +2 -2
  90. package/lib/view/plugin/cnzz.js +2 -2
  91. package/lib/view/plugin/cookie_consent.js +2 -2
  92. package/lib/view/plugin/gallery.js +2 -2
  93. package/lib/view/plugin/google_analytics.js +2 -2
  94. package/lib/view/plugin/hotjar.js +2 -2
  95. package/lib/view/plugin/katex.js +2 -2
  96. package/lib/view/plugin/mathjax.js +2 -2
  97. package/lib/view/plugin/outdated_browser.js +2 -2
  98. package/lib/view/plugin/progressbar.js +2 -2
  99. package/lib/view/plugin/statcounter.js +2 -2
  100. package/lib/view/plugin/twitter_conversion_tracking.js +2 -2
  101. package/lib/view/search/algolia.js +2 -2
  102. package/lib/view/search/baidu.js +2 -2
  103. package/lib/view/search/google_cse.js +2 -2
  104. package/lib/view/search/insight.js +2 -2
  105. package/lib/view/share/addthis.js +2 -2
  106. package/lib/view/share/addtoany.js +2 -2
  107. package/lib/view/share/bdshare.js +2 -2
  108. package/lib/view/share/sharejs.js +2 -2
  109. package/lib/view/share/sharethis.js +2 -2
  110. package/lib/view/widget/adsense.js +2 -2
  111. package/lib/view/widget/archives.js +2 -2
  112. package/lib/view/widget/categories.js +2 -2
  113. package/lib/view/widget/followit.js +2 -2
  114. package/lib/view/widget/links.js +2 -2
  115. package/lib/view/widget/recent_posts.js +2 -2
  116. package/lib/view/widget/subscribe_email.js +2 -2
  117. package/lib/view/widget/tags.js +16 -15
  118. package/lib/view/widget/toc.js +2 -2
  119. package/package.json +8 -12
@@ -43,11 +43,18 @@ module.exports = function (hexo) {
43
43
  }
44
44
 
45
45
  const site = {
46
- pages: locals.pages.map(mapPost),
47
46
  posts: locals.posts.map(mapPost),
48
47
  tags: locals.tags.map(mapTag),
49
48
  categories: locals.categories.map(mapTag)
50
49
  };
50
+ const index_pages = ((this.theme.config || {}).search || {}).index_pages;
51
+
52
+ if (index_pages === false) {
53
+ site.pages = [];
54
+ } else {
55
+ site.pages = locals.pages.map(mapPost);
56
+ }
57
+
51
58
  return {
52
59
  path: '/content.json',
53
60
  data: JSON.stringify(site)
@@ -79,4 +79,20 @@ test('Export assets file from asset folder', async () => {
79
79
  expect(data.tags.length).toBe(2);
80
80
  expect(data.tags.find(tag => tag.name === 'tag1' && tag.slug === 'tag1' && tag.link.includes('tag1'))).not.toBeUndefined();
81
81
  expect(data.tags.find(tag => tag.name === 'tag2' && tag.slug === 'tag2' && tag.link.includes('tag2'))).not.toBeUndefined();
82
+ });
83
+ test('Exclude pages from index when `index_pages` is false', async () => {
84
+ const locals = hexo.locals.toObject();
85
+ locals.config = hexo.config;
86
+ locals.posts = posts;
87
+ locals.pages = pages;
88
+ locals.categories = categories;
89
+ locals.tags = tags;
90
+ hexo.theme.config.search = {
91
+ index_pages: false
92
+ };
93
+ const generator = hexo.extend.generator.get('insight').bind(hexo);
94
+ const result = await generator(locals);
95
+ const data = JSON.parse(result.data);
96
+ expect(data.posts.length).toBe(2);
97
+ expect(data.pages.length).toBe(0);
82
98
  });
@@ -21,7 +21,7 @@ beforeAll(async () => {
21
21
  await hexo.init();
22
22
  await hexo.load();
23
23
  register(hexo);
24
- await hexo.loadPlugin(require.resolve('hexo-renderer-markdown'));
24
+ await hexo.loadPlugin(require.resolve('hexo-renderer-marked'));
25
25
  });
26
26
  test('create default message', async () => {
27
27
  const render = hexo.extend.tag.render.bind(hexo.extend.tag);
@@ -30,7 +30,7 @@ test('create default message', async () => {
30
30
  expect(actual).toEqual('<article class="message"> <div class="message-body"> ' + '<p><strong>content</strong></p> </div> </article>');
31
31
  source = '{% message %}\n# title\n{% endmessage %}';
32
32
  actual = cheerio.load(await render(source), cheerioOptions, false).html();
33
- expect(actual).toEqual('<article class="message"> <div class="message-body"> ' + '<h1 id="title"><a class="header-anchor" href="#title">&#xB6;</a> title</h1> ' + '</div> </article>');
33
+ expect(actual).toEqual('<article class="message"> <div class="message-body"> ' + '<h1 id="title"><a href="#title" class="headerlink" title="title"/>title</h1> ' + '</div> </article>');
34
34
  });
35
35
  test('create message with different colors', async () => {
36
36
  const render = hexo.extend.tag.render.bind(hexo.extend.tag);
@@ -21,7 +21,7 @@ beforeAll(async () => {
21
21
  await hexo.init();
22
22
  await hexo.load();
23
23
  register(hexo);
24
- await hexo.loadPlugin(require.resolve('hexo-renderer-markdown'));
24
+ await hexo.loadPlugin(require.resolve('hexo-renderer-marked'));
25
25
  });
26
26
  test('create default tabs', async () => {
27
27
  const render = hexo.extend.tag.render.bind(hexo.extend.tag);
@@ -35,7 +35,7 @@ test('create default tabs', async () => {
35
35
  const $ = cheerio.load(await render(source), cheerioOptions, false);
36
36
  const [tabId1, tabId2] = $('.tab-content').get().map(element => $(element).attr('id'));
37
37
  actual = $.html();
38
- expect(actual).toEqual(`<div class="tabs my-3"> <ul class="mx-0 my-0"> <li> <a href="#${tabId1}"> </a> ` + `</li><li> <a href="#${tabId2}"> </a> </li> </ul> </div> ` + `<div id="${tabId1}" class="tab-content is-hidden"> <h1 id="title 1">` + '<a class="header-anchor" href="#title 1">&#xB6;</a> title 1</h1> </div>' + `<div id="${tabId2}" class="tab-content is-hidden"> <h1 id="title 2">` + '<a class="header-anchor" href="#title 2">&#xB6;</a> title 2</h1> </div>');
38
+ expect(actual).toEqual(`<div class="tabs my-3"> <ul class="mx-0 my-0"> <li> <a href="#${tabId1}"> </a> ` + `</li><li> <a href="#${tabId2}"> </a> </li> </ul> </div> ` + `<div id="${tabId1}" class="tab-content is-hidden"> <h1 id="title-1">` + '<a href="#title-1" class="headerlink" title="title 1"/>title 1</h1> </div>' + `<div id="${tabId2}" class="tab-content is-hidden"> <h1 id="title-2">` + '<a href="#title-2" class="headerlink" title="title 2"/>title 2</h1> </div>');
39
39
  });
40
40
  test('create tabs with different alignment', async () => {
41
41
  const render = hexo.extend.tag.render.bind(hexo.extend.tag);
@@ -93,5 +93,5 @@ test('create tabs with all properties', async () => {
93
93
  <!-- tab id:tab2 active 'title:Tim\\'s Tab' -->tab 2<!-- endtab -->
94
94
  {% endtabs %}`;
95
95
  const actual = cheerio.load(await render(source), cheerioOptions, false).html();
96
- expect(actual).toEqual('<div class="tabs my-3 is-fullwidth is-large is-boxed"> <ul class="mx-0 my-0"> <li> ' + '<a href="#tab1"> <span class="icon is-small ml-0"> ' + '<i class="fas\\ fa-file" aria-hidden="true"/> </span> </a> </li><li class="is-active"> ' + '<a href="#tab2"> <p>Tim&#x2019;s Tab</p> </a> </li> </ul> </div> ' + '<div id="tab1" class="tab-content is-hidden"> <p>tab 1</p> </div>' + '<div id="tab2" class="tab-content"> <p>tab 2</p> </div>');
96
+ expect(actual).toEqual('<div class="tabs my-3 is-fullwidth is-large is-boxed"> <ul class="mx-0 my-0"> <li> ' + '<a href="#tab1"> <span class="icon is-small ml-0"> ' + '<i class="fas\\ fa-file" aria-hidden="true"/> </span> </a> </li><li class="is-active"> ' + '<a href="#tab2"> <p>Tim&apos;s Tab</p> </a> </li> </ul> </div> ' + '<div id="tab1" class="tab-content is-hidden"> <p>tab 1</p> </div>' + '<div id="tab2" class="tab-content"> <p>tab 2</p> </div>');
97
97
  });
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/twikoo.json",
4
+ "description": "Twikoo comment plugin configurations",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "twikoo"
10
+ },
11
+ "env_id": {
12
+ "type": "string",
13
+ "description": "envId from Tencent CloudBase"
14
+ }
15
+ },
16
+ "required": ["type", "env_id"]
17
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/changyan.json",
4
+ "description": "Changyan comment plugin configurations",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "changyan"
10
+ },
11
+ "app_id": {
12
+ "type": "string",
13
+ "description": "Changyan app ID"
14
+ },
15
+ "conf": {
16
+ "type": "string",
17
+ "description": "Changyan configuration ID"
18
+ }
19
+ },
20
+ "required": ["type", "app_id", "conf"]
21
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/disqus.json",
4
+ "description": "Disqus comment plugin configurations",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "disqus"
10
+ },
11
+ "shortname": {
12
+ "type": "string",
13
+ "description": "Disqus shortname"
14
+ }
15
+ },
16
+ "required": ["type", "shortname"]
17
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/disqusjs.json",
4
+ "description": "DisqusJS comment plugin configurations",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "disqusjs"
10
+ },
11
+ "shortname": {
12
+ "type": "string",
13
+ "description": "Disqus shortname"
14
+ },
15
+ "api_key": {
16
+ "description": "Disqus application API key",
17
+ "anyOf": [
18
+ {
19
+ "type": "string"
20
+ },
21
+ {
22
+ "type": "array",
23
+ "minItems": 1,
24
+ "items": {
25
+ "type": "string"
26
+ }
27
+ }
28
+ ]
29
+ },
30
+ "api": {
31
+ "type": "string",
32
+ "description": "Disqus API endpoint"
33
+ },
34
+ "admin": {
35
+ "type": "string",
36
+ "description": "Disqus moderator username",
37
+ "nullable": true
38
+ },
39
+ "admin_label": {
40
+ "type": "string",
41
+ "description": "Disqus moderator badge text",
42
+ "default": false,
43
+ "nullable": true
44
+ },
45
+ "nesting": {
46
+ "type": "integer",
47
+ "description": "Maximum number of comment nesting level",
48
+ "default": 4,
49
+ "nullable": true
50
+ }
51
+ },
52
+ "required": ["type", "shortname", "api_key"]
53
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/facebook.json",
4
+ "description": "Facebook comment plugin configurations",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "facebook"
10
+ }
11
+ },
12
+ "required": ["type"]
13
+ }
@@ -0,0 +1,81 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/gitalk.json",
4
+ "description": "Gitalk comment plugin configurations",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "gitalk"
10
+ },
11
+ "client_id": {
12
+ "type": "string",
13
+ "description": "GitHub application client ID"
14
+ },
15
+ "client_secret": {
16
+ "type": "string",
17
+ "description": "GitHub application client secret"
18
+ },
19
+ "repo": {
20
+ "type": "string",
21
+ "description": "GitHub repository"
22
+ },
23
+ "owner": {
24
+ "type": "string",
25
+ "description": "GitHub repository owner. Can be personal user or organization"
26
+ },
27
+ "admin": {
28
+ "type": "array",
29
+ "description": "GitHub repository owner and collaborators. (Users who having write access to this repository)",
30
+ "items": {
31
+ "type": "string"
32
+ }
33
+ },
34
+ "per_page": {
35
+ "type": "number",
36
+ "description": "Pagination size, with maximum 100",
37
+ "default": 10,
38
+ "nullable": true
39
+ },
40
+ "distraction_free_mode": {
41
+ "type": "boolean",
42
+ "description": "Facebook-like distraction free mode",
43
+ "default": false,
44
+ "nullable": true
45
+ },
46
+ "pager_direction": {
47
+ "type": "string",
48
+ "description": "Comment sorting direction, available values are `last` and `first`",
49
+ "default": "last",
50
+ "nullable": true
51
+ },
52
+ "create_issue_manually": {
53
+ "type": "boolean",
54
+ "description": "Create GitHub issues manually for each page",
55
+ "default": false,
56
+ "nullable": true
57
+ },
58
+ "proxy": {
59
+ "type": "string",
60
+ "description": "GitHub oauth request reverse proxy for CORS",
61
+ "nullable": true
62
+ },
63
+ "flip_move_options": {
64
+ "type": "object",
65
+ "description": "Comment list animation",
66
+ "nullable": true
67
+ },
68
+ "enable_hotkey": {
69
+ "type": "boolean",
70
+ "description": "Enable hot key (cmd|ctrl + enter) submit comment",
71
+ "default": true,
72
+ "nullable": true
73
+ },
74
+ "language": {
75
+ "type": "string",
76
+ "description": "Name of the supported language",
77
+ "nullable": true
78
+ }
79
+ },
80
+ "required": ["type", "client_id", "client_secret", "repo", "owner", "admin"]
81
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/gitment.json",
4
+ "description": "Gitment comment plugin configurations",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "gitment"
10
+ },
11
+ "owner": {
12
+ "type": "string",
13
+ "description": "Your GitHub ID"
14
+ },
15
+ "repo": {
16
+ "type": "string",
17
+ "description": "The repository to store your comments. Make sure you're repo's owner"
18
+ },
19
+ "client_id": {
20
+ "type": "string",
21
+ "description": "GitHub client ID"
22
+ },
23
+ "client_secret": {
24
+ "type": "string",
25
+ "description": "GitHub client secret"
26
+ },
27
+ "theme": {
28
+ "type": "string",
29
+ "description": "An optional Gitment theme object",
30
+ "default": "gitment.defaultTheme",
31
+ "nullable": true
32
+ },
33
+ "per_page": {
34
+ "type": "number",
35
+ "description": "An optional number to which comments will be paginated",
36
+ "default": 20,
37
+ "nullable": true
38
+ },
39
+ "max_comment_height": {
40
+ "type": "number",
41
+ "description": "An optional number to limit comments' max height, over which comments will be folded",
42
+ "default": 250,
43
+ "nullable": true
44
+ }
45
+ },
46
+ "required": ["type", "owner", "repo", "client_id", "client_secret"]
47
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/isso.json",
4
+ "description": "Isso comment plugin configurations",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "isso"
10
+ },
11
+ "url": {
12
+ "type": "string",
13
+ "description": "URL to your Isso comment service"
14
+ }
15
+ },
16
+ "required": ["type", "url"]
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/livere.json",
4
+ "description": "Livere comment plugin configurations",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "livere"
10
+ },
11
+ "uid": {
12
+ "type": "string",
13
+ "description": "LiveRe comment service UID"
14
+ }
15
+ },
16
+ "required": ["type", "uid"]
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/twikoo.json",
4
+ "description": "Twikoo comment plugin configurations",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "twikoo"
10
+ },
11
+ "env_id": {
12
+ "type": "string",
13
+ "description": "envId from Tencent CloudBase"
14
+ }
15
+ },
16
+ "required": ["type", "env_id"]
17
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/utterances.json",
4
+ "description": "Utterances comment plugin configurations",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "utterances"
10
+ },
11
+ "repo": {
12
+ "type": "string",
13
+ "description": "GitHub repository to which Utterances connects"
14
+ },
15
+ "label": {
16
+ "type": "string",
17
+ "description": "Label assigned to issues created by Utterances",
18
+ "nullable": true
19
+ },
20
+ "theme": {
21
+ "type": "string",
22
+ "description": "Utterances look and feel",
23
+ "enum": [
24
+ "github-light",
25
+ "github-dark",
26
+ "github-dark-orange",
27
+ "icy-dark",
28
+ "dark-blue",
29
+ "photon-dark"
30
+ ],
31
+ "default": "github-light",
32
+ "nullable": true
33
+ }
34
+ },
35
+ "required": ["type", "repo"],
36
+ "oneOf": [
37
+ {
38
+ "type": "object",
39
+ "properties": {
40
+ "issue_term": {
41
+ "type": "string",
42
+ "description": "The mapping between blog posts and GitHub issues",
43
+ "default": "pathname"
44
+ }
45
+ },
46
+ "required": ["issue_term"]
47
+ },
48
+ {
49
+ "type": "object",
50
+ "properties": {
51
+ "issue_number": {
52
+ "type": "integer",
53
+ "description": "Configure Utterances to load a specific issue by number"
54
+ }
55
+ },
56
+ "required": ["issue_number"]
57
+ }
58
+ ]
59
+ }
@@ -0,0 +1,105 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "/comment/valine.json",
4
+ "description": "Valine comment plugin configurations",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "valine"
10
+ },
11
+ "app_id": {
12
+ "type": "string",
13
+ "description": "Application <APP_ID> from Leancloud"
14
+ },
15
+ "app_key": {
16
+ "type": "string",
17
+ "description": "Application <APP_KEY> from Leancloud"
18
+ },
19
+ "placeholder": {
20
+ "type": "string",
21
+ "description": "Comment box placeholders",
22
+ "nullable": true
23
+ },
24
+ "avatar": {
25
+ "type": "string",
26
+ "description": "Gravatar type",
27
+ "enum": ["", "mp", "identicon", "monsterid", "wavatar", "robohash", "retro", "hide", "mm"],
28
+ "default": "mm",
29
+ "nullable": true
30
+ },
31
+ "avatar_force": {
32
+ "type": "boolean",
33
+ "description": "Pull the latest avatar upon page visit",
34
+ "default": false,
35
+ "nullable": true
36
+ },
37
+ "meta": {
38
+ "type": "array",
39
+ "description": "Reviewer attributes",
40
+ "items": {
41
+ "type": "string"
42
+ },
43
+ "default": ["nick", "mail", "link"],
44
+ "nullable": true
45
+ },
46
+ "page_size": {
47
+ "type": "integer",
48
+ "description": "Number of comments per page",
49
+ "default": 10,
50
+ "nullable": true
51
+ },
52
+ "lang": {
53
+ "type": "string",
54
+ "description": "i18n support",
55
+ "default": "zh-CN",
56
+ "nullable": true
57
+ },
58
+ "visitor": {
59
+ "type": "boolean",
60
+ "description": "Show visitor count",
61
+ "default": false,
62
+ "nullable": true
63
+ },
64
+ "highlight": {
65
+ "type": "boolean",
66
+ "description": "Enable code highlighting",
67
+ "default": true,
68
+ "nullable": true
69
+ },
70
+ "record_ip": {
71
+ "type": "boolean",
72
+ "description": "Record reviewer IP address",
73
+ "default": false,
74
+ "nullable": true
75
+ },
76
+ "server_urls": {
77
+ "type": "string",
78
+ "description": "Root URL of your custom domain",
79
+ "nullable": true
80
+ },
81
+ "emoji_cdn": {
82
+ "type": "string",
83
+ "description": "CDN URL of the Emoji provider",
84
+ "nullable": true
85
+ },
86
+ "emoji_maps": {
87
+ "type": "object",
88
+ "description": "Mappings between emoji and its CDN file name",
89
+ "nullable": true
90
+ },
91
+ "enable_qq": {
92
+ "type": "boolean",
93
+ "description": "Enable QQ nickname and avatar",
94
+ "default": false,
95
+ "nullable": true
96
+ },
97
+ "required_fields": {
98
+ "type": "array",
99
+ "description": "Required commenter information fields",
100
+ "default": [],
101
+ "nullable": true
102
+ }
103
+ },
104
+ "required": ["type", "app_id", "app_key"]
105
+ }