Merge pull request #145 from syahravi/graphcomment

add partial "graphcomment"
This commit is contained in:
Dmitry Kolosov 2022-02-26 17:28:08 +03:00 committed by GitHub
commit 0af5554f87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 2 deletions

View File

@ -21,6 +21,9 @@ readNextPosts = 2
copyCodeButton = true
rssAsSocialIcon = true
# Graphcomment support
graphcommentId = ""
# utteranc.es support
utterancesRepo = "" # mandatory
utterancesTheme = "" # optional
@ -60,4 +63,4 @@ category = "categories"
tag = "tags"
[markup.goldmark.renderer]
unsafe = true
unsafe = true

View File

@ -22,6 +22,9 @@ readNextPosts = 2
copyCodeButton = true
rssAsSocialIcon = true
# Graphcomment support
graphcommentId = ""
# utteranc.es support
utterancesRepo = "" # mandatory
utterancesTheme = "" # optional
@ -83,4 +86,4 @@ category = "categories"
tag = "tags"
[markup.goldmark.renderer]
unsafe = true
unsafe = true

View File

@ -49,4 +49,8 @@
{{ partial "isso.html" . }}
{{ end }}
{{ if .Site.Params.graphcommentId }}
{{ partial "graphcomment.html" . }}
{{ end }}
{{ end }}

View File

@ -0,0 +1,32 @@
<div id="graphcomment"></div>
<script type="text/javascript">
/* - - - CONFIGURATION VARIABLES - - - */
var __semio__params = {
graphcommentId: "{{ .Site.Params.graphcommentId }}", // obviously you need to create your own ID on graphcomment.com
behaviour: {
// HIGHLY RECOMMENDED
// uid: "...", // uniq identifer for the comments thread on your page (ex: your page id)
},
// configure your variables here
}
/* - - - DON'T EDIT BELOW THIS LINE - - - */
function __semio__onload() {
__semio__gc_graphlogin(__semio__params)
}
(function() {
var gc = document.createElement('script'); gc.type = 'text/javascript'; gc.async = true;
gc.onload = __semio__onload; gc.defer = true; gc.src = 'https://integration.graphcomment.com/gc_graphlogin.js?' + Date.now();
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(gc);
})();
</script>