diff options
| author | Anoduck, The Anonymous Duck <9925396+anoduck@users.noreply.github.com> | 2025-02-16 09:16:39 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-16 09:16:39 +0000 |
| commit | b5290138e1f73a7a56578f9975ba3b50829ca8d4 (patch) | |
| tree | b4d2d0d4a5b10754f0d075248f97f63f74bbb9aa /layouts/partials | |
| parent | 5354e537b7e02b96cf0b842adfc5faaae5d1a862 (diff) | |
| parent | 5086a041c02412f1a5f811325d4798c49acd328b (diff) | |
Merge pull request #77 from anoduck/develop
Regardless of failed style linting pulling this shit.
Diffstat (limited to 'layouts/partials')
| -rw-r--r-- | layouts/partials/disqus.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html new file mode 100644 index 0000000..8caab7b --- /dev/null +++ b/layouts/partials/disqus.html @@ -0,0 +1,24 @@ +{{- $pc := .Site.Config.Privacy.Disqus -}} +{{- if not $pc.Disable -}} +{{ if .Site.Config.Services.Disqus.Shortname }}<div id="disqus_thread"></div> +<script> + window.disqus_config = function () { + {{with .Params.disqus_identifier }}this.page.identifier = '{{ . }}';{{end}} + {{with .Params.disqus_title }}this.page.title = '{{ . }}';{{end}} + {{with .Params.disqus_url }}this.page.url = '{{ . | html }}';{{end}} + }; + (function() { + // if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) { + // document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.'; + // return; + // } + var d = document, s = d.createElement('script'); s.async = true; + s.src = '//' + {{ .Site.Config.Services.Disqus.Shortname }} + '.disqus.com/embed.js'; + console.log(s.src); + s.setAttribute('data-timestamp', +new Date()); + (d.head || d.body).appendChild(s); + })(); +</script> +<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> +<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>{{end}} +{{- end -}}
\ No newline at end of file |
