diff options
author | Nan Xiao <road2stat@gmail.com> | 2017-12-27 09:57:58 +0300 |
---|---|---|
committer | Nan Xiao <road2stat@gmail.com> | 2017-12-27 09:57:58 +0300 |
commit | e7b8dc0c4480a907e0325220f8185cbe7ef7e19f (patch) | |
tree | 4d4cd8d5653688bbc7e509533b31bf9f0ec48a23 | |
parent | ea377101e8f9e7d61b8a8ba3c1f714cbd2ff46c1 (diff) |
add disqus
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/partials/disqus.html | 18 | ||||
-rw-r--r-- | theme.toml | 1 |
4 files changed, 22 insertions, 0 deletions
@@ -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> @@ -6,6 +6,7 @@ homepage = "https://github.com/road2stat/hugo-tanka" tags = [] features = [] min_version = 0.17 +disqusShortname = "" # author of this modified version [[author]] |