1
0
Fork 0

Merge pull request #135 from TechWithOmid/graph-comment

Add graph comment
This commit is contained in:
南小北 2023-01-09 01:37:45 +08:00 committed by GitHub
commit c4a53de0b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 0 deletions

View file

@ -64,6 +64,8 @@ disqusShortname = 'YOUR_DISQUS_SHORTNAME' # add disqus comments
name = 'YOUR_NAME'
bio = 'YOUR_BIO'
graphcommentId = "graph id" # add graph comments id (disqus alternative)
# misc
disableHLJS = true # disable requesting highlight.js
monoDarkIcon = true # show monochrome dark mode icon

View file

@ -25,6 +25,7 @@ title = "Paper"
name = 'Lee'
bio = 'Discover fresh context'
graphcommentId = "your graph id"
# ------------------------------
# needed to render raw HTML (e.g. <sub>, <sup>, <kbd>, <mark>)

View file

@ -66,6 +66,34 @@
document.head.appendChild(script);
</script>
{{ end }}
<!-- GraphComments -->
{{ if and site.Params.graphcommentId (not (eq .Params.comments false)) }}
<div class="mt-24" id="graphcomment"></div>
<script type="text/javascript">
var __semio__params = {
graphcommentId: "{{ .Site.Params.graphcommentId }}",
behaviour: {
// uid: "...",
},
// configure your variables here
}
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>
{{ end }}
</article>
{{ end }}