Permalink
Browse files

thems: Fix disqus identifier not set correctly

Signed-off-by: Xuanwo <xuanwo.cn@gmail.com>
  • Loading branch information...
Xuanwo committed Oct 5, 2018
1 parent a7467e5 commit bfb38029cabe8f3a5b1c33f808644e89cb5111b9
Showing with 19 additions and 1 deletion.
  1. +1 −1 themes/minos/layouts/_default/single.html
  2. +18 −0 themes/minos/layouts/partials/disqus.html
@@ -5,7 +5,7 @@
{{ partial "header.html" . }}
<section id="main" class="outer">
{{ partial "article.html" . }}
{{ template "_internal/disqus.html" . }}
{{ partial "disqus.html" . }}
</section>
{{ partial "footer.html" . }}
</div>
@@ -0,0 +1,18 @@
{{- $pc := .Page.Site.Config.Privacy.Disqus -}}
{{- if not $pc.Disable -}}
{{ if .Site.DisqusShortname }}<div id="disqus_thread"></div>
<script type="application/javascript">
var disqus_config = function () {
this.page.identifier = '{{ .URL }}';
this.page.title = '{{ .Title }}';
this.page.url = '{{ .Permalink }}';
};
(function() {
var d = document, s = d.createElement('script'); s.async = true;
s.src = '//' + {{ .Site.DisqusShortname }} + '.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>{{end}}
{{- end -}}

0 comments on commit bfb3802

Please sign in to comment.