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

github.com/nanxstats/hugo-tanka.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNan Xiao <road2stat@gmail.com>2017-12-27 09:57:58 +0300
committerNan Xiao <road2stat@gmail.com>2017-12-27 09:57:58 +0300
commite7b8dc0c4480a907e0325220f8185cbe7ef7e19f (patch)
tree4d4cd8d5653688bbc7e509533b31bf9f0ec48a23
parentea377101e8f9e7d61b8a8ba3c1f714cbd2ff46c1 (diff)
add disqus
-rw-r--r--README.md1
-rw-r--r--layouts/_default/single.html2
-rw-r--r--layouts/partials/disqus.html18
-rw-r--r--theme.toml1
4 files changed, 22 insertions, 0 deletions
diff --git a/README.md b/README.md
index 5b0ea20..e5617fe 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,7 @@ This Hugo theme is ported from the [Hugo Black & Light theme](https://github.com
- Styles inlined in head.
- High Contrast.
- High Resolution Favicons.
+- Disqus
![Screenshot](https://github.com/road2stat/hugo-tanka/blob/master/images/screenshot.png)
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index aa8b777..e0b3e6a 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -21,4 +21,6 @@
</div>
</section>
+{{ partial "disqus.html" .}}
+
{{ partial "footer.html" . }}
diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html
new file mode 100644
index 0000000..4c0a62e
--- /dev/null
+++ b/layouts/partials/disqus.html
@@ -0,0 +1,18 @@
+<section id="comments">
+<div id="disqus_thread"></div>
+<script type="text/javascript">
+
+(function() {
+ // Don't ever inject Disqus on localhost--it creates unwanted
+ // discussions from 'localhost:1313' on your Disqus account...
+ if (window.location.hostname == "localhost")
+ return;
+
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ var disqus_shortname = '{{ .Site.DisqusShortname }}';
+ dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+})();
+</script>
+<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+</section>
diff --git a/theme.toml b/theme.toml
index 6f6de9b..1b63f4a 100644
--- a/theme.toml
+++ b/theme.toml
@@ -6,6 +6,7 @@ homepage = "https://github.com/road2stat/hugo-tanka"
tags = []
features = []
min_version = 0.17
+disqusShortname = ""
# author of this modified version
[[author]]