diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index de79054..ee93322 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,4 +1,4 @@ Please make sure you took care of the following things before you submit this issue. Thank you! -- [ ] I have set up and configured my blog according to [Hexo documentation](https://hexo.io/) and [Icarus Documentation](https://github.com/ppoffice/hexo-theme-icarus/wiki); -- [ ] I have looked up the [Github Issues](https://github.com/ppoffice/hexo-theme-icarus/issues) and found no solutions to my problems. +- [ ] I have set up and configured my blog according to the [Hexo docs](https://hexo.io/) and the [Icarus docs](https://ppoffice.github.io/hexo-theme-icarus/); +- [ ] I have looked up [Github issues](https://github.com/ppoffice/hexo-theme-icarus/issues) and found no solutions to my problems. diff --git a/README.md b/README.md index 05651f0..1b3bc74 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,10 @@ Please refer to the documentation for Icarus implementation details. ### :tada: Contribute +If you feel like to help us build a better Icarus, you can + :electric_plug: Write a plugin | +:black_nib: Submit a tutorial | :triangular_flag_on_post: Report a bug | :earth_asia: Add a translation diff --git a/includes/common/utils.js b/includes/common/utils.js index 882fccc..6508f7d 100644 --- a/includes/common/utils.js +++ b/includes/common/utils.js @@ -15,6 +15,9 @@ const descriptors = { }; const is = (() => ({ + number(value) { + return typeof (value) === 'number'; + }, string(value) { return typeof (value) === 'string'; }, diff --git a/includes/specs/plugins.spec.js b/includes/specs/plugins.spec.js index 1196770..71e6b88 100644 --- a/includes/specs/plugins.spec.js +++ b/includes/specs/plugins.spec.js @@ -1,4 +1,4 @@ -const { doc, type, defaultValue, required, requires } = require('../common/utils').descriptors; +const { doc, type, defaultValue } = require('../common/utils').descriptors; module.exports = { [type]: 'object', @@ -45,5 +45,14 @@ module.exports = { [doc]: 'Baidu Analytics tracking id', [defaultValue]: null } + }, + hotjar: { + [type]: ['boolean', 'object'], + [doc]: 'Hotjar user feedback plugin (http://ppoffice.github.io/hexo-theme-icarus/2018/01/01/plugin/Analytics/#Hotjar)', + site_id: { + [type]: ['string', 'number'], + [doc]: 'Hotjar site id', + [defaultValue]: null + } } }; \ No newline at end of file diff --git a/layout/plugin/hotjar.ejs b/layout/plugin/hotjar.ejs new file mode 100644 index 0000000..0d88940 --- /dev/null +++ b/layout/plugin/hotjar.ejs @@ -0,0 +1,12 @@ +<% if (head && get_config_from_obj(plugin, 'site_id')) { %> + +<% } %>