diff --git a/includes/specs/comment.spec.js b/includes/specs/comment.spec.js index da78521..04a5aab 100644 --- a/includes/specs/comment.spec.js +++ b/includes/specs/comment.spec.js @@ -124,6 +124,33 @@ const ValineSpec = { } }; +const UtterancesSpec = { + repo: { + [type]: 'string', + [doc]: 'The repository willed connect to utterances', + [required]: true, + [requires]: comment => comment.type === 'utterances' + }, + issue_term: { + [type]: 'string', + [doc]: 'Blog Post ↔️ Issue Mapping', + [defaultValue]: 'pathname', + [requires]: comment => comment.type === 'utterances' + }, + label: { + [type]: 'string', + [doc]: 'Issue Label', + [defaultValue]: '', + [requires]: comment => comment.type === 'utterances' + }, + theme: { + [type]: 'string', + [doc]: 'Utterances theme', + [defaultValue]: 'github-light', + [requires]: comment => comment.type === 'utterances' + } +}; + module.exports = { [type]: 'object', [doc]: 'Comment plugin settings\nhttps://ppoffice.github.io/hexo-theme-icarus/categories/Plugins/Comment', @@ -137,5 +164,6 @@ module.exports = { ...GitmentGitalkSpec, ...IssoSpec, ...LiveReSpec, - ...ValineSpec + ...ValineSpec, + ...UtterancesSpec } \ No newline at end of file diff --git a/layout/comment/utterances.ejs b/layout/comment/utterances.ejs new file mode 100644 index 0000000..9278a2e --- /dev/null +++ b/layout/comment/utterances.ejs @@ -0,0 +1,14 @@ +<% if (!has_config('comment.repo')) { %> +
+ You forgot to set the repo for utteranc.es Please set it in _config.yml. +
+<% } else { %> + +<% } %> \ No newline at end of file diff --git a/layout/comment/utterances.locals.js b/layout/comment/utterances.locals.js new file mode 100644 index 0000000..bec3126 --- /dev/null +++ b/layout/comment/utterances.locals.js @@ -0,0 +1,3 @@ +module.exports = (ctx, locals) => { + return locals; +} \ No newline at end of file