cupper-hugo-theme/layouts/partials/disqus.html

28 lines
965 B
HTML
Raw Normal View History

2019-03-05 21:59:47 +01:00
<div id="disqus-container">
{{ with .Site.DisqusShortname }}
<button id="disqus-button" onclick="showComments()">{{ T "discuss_show_comments_button" }}</button>
2019-03-05 21:59:47 +01:00
<div id="disqus-comments">
{{ $isDummyName := eq . "yourdiscussshortname" }}
{{ $isServer := $.Site.IsServer }}
{{ if or $isDummyName $isServer }}
<p><em>{{ T "discuss_comments_disabled" }}</em></p>
<script type="application/javascript">
function showComments() {
{{ partial "disqus-js-common.js" . | safeJS }}
}
</script>
2019-03-05 21:59:47 +01:00
{{ else }}
<div id="disqus_thread">
</div>
<script type="application/javascript">
function showComments() {
{{ partial "disqus-js-main.js" . | safeJS }}
{{ partial "disqus-js-common.js" . | safeJS }}
}
</script>
2019-03-05 21:59:47 +01:00
{{ end }}
<noscript>{{ T "discuss_js_disabled" }}</noscript>
2019-03-05 21:59:47 +01:00
</div>
{{ end }}
</div>