Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/hossainemruz/toha.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/_default/single.html3
-rw-r--r--layouts/partials/utteranc.html22
2 files changed, 25 insertions, 0 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 2423a98..633fe1f 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -165,6 +165,9 @@
<!-- Add valine -->
{{ else if .valine }}
{{ partial "valine.html" . }}
+ <!-- Add utteranc -->
+ {{ else if .utteranc }}
+ {{ partial "utteranc.html" . }}
{{ end }}
{{ end }}
{{ end }}
diff --git a/layouts/partials/utteranc.html b/layouts/partials/utteranc.html
new file mode 100644
index 0000000..0bbaaad
--- /dev/null
+++ b/layouts/partials/utteranc.html
@@ -0,0 +1,22 @@
+{{ $repo := site.Params.features.comment.utteranc.repo }}
+{{ $issueTerm := site.Params.features.comment.utteranc.issueTerm }}
+{{ $theme := site.Params.features.comment.utteranc.theme }}
+
+<div id="utteranc_thread"></div>
+<div id="comments" class="comments">
+ <div id="comments-container"></div>
+</div>
+<script type="text/javascript">
+ (function() {
+ var utterances = document.createElement('script');
+ utterances.type = 'text/javascript';
+ utterances.async = true;
+ utterances.setAttribute('repo','{{ $repo }}')
+ utterances.setAttribute('issue-term','{{ $issueTerm }}')
+ utterances.setAttribute('theme','{{ $theme }}')
+ utterances.crossorigin = 'anonymous';
+ utterances.src = 'https://utteranc.es/client.js';
+
+ document.getElementById('comments-container').appendChild(utterances);
+ })();
+</script>