mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	tpl: Simplify the Disqus template a little bit (#3655)
In accordance to the official guide: https://disqus.com/admin/universal/
This commit is contained in:
		@@ -166,7 +166,7 @@ func (t *templateHandler) embedTemplates() {
 | 
				
			|||||||
{{ end }}`)
 | 
					{{ end }}`)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	t.addInternalTemplate("", "disqus.html", `{{ if .Site.DisqusShortname }}<div id="disqus_thread"></div>
 | 
						t.addInternalTemplate("", "disqus.html", `{{ if .Site.DisqusShortname }}<div id="disqus_thread"></div>
 | 
				
			||||||
<script type="text/javascript">
 | 
					<script>
 | 
				
			||||||
    var disqus_config = function () {
 | 
					    var disqus_config = function () {
 | 
				
			||||||
    {{with .GetParam "disqus_identifier" }}this.page.identifier = '{{ . }}';{{end}}
 | 
					    {{with .GetParam "disqus_identifier" }}this.page.identifier = '{{ . }}';{{end}}
 | 
				
			||||||
    {{with .GetParam "disqus_title" }}this.page.title = '{{ . }}';{{end}}
 | 
					    {{with .GetParam "disqus_title" }}this.page.title = '{{ . }}';{{end}}
 | 
				
			||||||
@@ -177,9 +177,10 @@ func (t *templateHandler) embedTemplates() {
 | 
				
			|||||||
            document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
 | 
					            document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
 | 
					        var d = document, s = d.createElement('script'); s.async = true;
 | 
				
			||||||
        dsq.src = '//' + {{ .Site.DisqusShortname }} + '.disqus.com/embed.js';
 | 
					        s.src = '//' + {{ .Site.DisqusShortname }} + '.disqus.com/embed.js';
 | 
				
			||||||
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
 | 
					        s.setAttribute('data-timestamp', +new Date());
 | 
				
			||||||
 | 
					        (d.head || d.body).appendChild(s);
 | 
				
			||||||
    })();
 | 
					    })();
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
 | 
					<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user