feat: comments disqus + commento

This commit is contained in:
NGPixel
2020-05-16 22:46:05 -04:00
committed by Nicolas Giard
parent f6bad765a2
commit 887e8a0f5a
20 changed files with 1292 additions and 1067 deletions

View File

@@ -1,4 +1,12 @@
main: |
<div id="commento"></div>
bodyEnd: |
<script defer src="{{instanceUrl}}/js/commento.js"></script>
body: |
<script>
window.onload = function() {
var d = document, s = d.createElement('script');
s.src = '{{instanceUrl}}/js/commento.js';
s.defer = true
s.setAttribute('data-auto-init', true);
(d.head || d.body).appendChild(s);
};
</script>

View File

@@ -4,9 +4,8 @@ description: A fast, privacy-focused commenting platform.
author: requarks.io
logo: https://static.requarks.io/logo/commento.svg
website: https://commento.io/
displayMode: footer
codeTemplate: true
isAvailable: false
isAvailable: true
props:
instanceUrl:
type: String

View File

@@ -0,0 +1,11 @@
/* global WIKI */
// ------------------------------------
// Default Comment Provider
// ------------------------------------
module.exports = {
add (args) {
}
}

View File

@@ -4,7 +4,6 @@ description: Built-in advanced comments tool.
author: requarks.io
logo: https://static.requarks.io/logo/wikijs-butterfly.svg
website: https://wiki.js.org
displayMode: dynamic
codeTemplate: false
isAvailable: true
props:

View File

@@ -1,14 +1,14 @@
main: |
<div id="disqus_thread"></div>
bodyEnd: |
body: |
<script>
var disqus_config = function () {
this.page.url = {{pageUrl}};
this.page.identifier = {{pageId}};
this.page.url = '{{pageUrl}}';
this.page.identifier = '{{pageId}}';
};
(function() {
var d = document, s = d.createElement('script');
s.src = 'https://{{shortName}}.disqus.com/embed.js';
s.src = 'https://{{accountName}}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();

View File

@@ -4,9 +4,8 @@ description: Disqus help publishers power online discussions with comments.
author: requarks.io
logo: https://static.requarks.io/logo/disqus.svg
website: https://disqus.com/
displayMode: footer
codeTemplate: true
isAvailable: false
isAvailable: true
props:
accountName:
type: String

View File

@@ -12,7 +12,7 @@ module.exports = {
md.renderer.rules.emoji = (token, idx) => {
return twemoji.parse(token[idx].content, {
callback (icon, opts) {
return `/svg/twemoji/${icon}.svg`
return `/_assets/svg/twemoji/${icon}.svg`
}
})
}