parent
6c57464b63
commit
e1cffe7827
|
@ -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
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<% if (!has_config('comment.repo')) { %>
|
||||
<div class="notification is-danger">
|
||||
You forgot to set the <code>repo</code> for utteranc.es Please set it in <code>_config.yml</code>.
|
||||
</div>
|
||||
<% } else { %>
|
||||
<script src="https://utteranc.es/client.js"
|
||||
repo="<%= get_config('comment.repo') %>"
|
||||
issue-term="<%= get_config('comment.issue-term') %>"
|
||||
label="<%= get_config('comment.label') %>"
|
||||
theme="<%= get_config('comment.theme') %>"
|
||||
crossorigin="anonymous"
|
||||
async>
|
||||
</script>
|
||||
<% } %>
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = (ctx, locals) => {
|
||||
return locals;
|
||||
}
|
Loading…
Reference in New Issue