{% if site.xaymar.comments.enabled and page.comments %}
<div class="comments">
	<div class="title">
		Comments for: {{ page.title }}
	</div>
	<div class="content">
		{% if site.xaymar.comments.provider == "disqus" %}
			{% assign disqus_page_url = page.id | default: page.url %}
			{% assign disqus_site_url = site.url %}
			{% assign disqus_url = site.xaymar.comments.disqus.url | replace: ":siteurl", disqus_site_url | replace: ":pageurl", disqus_page_url %}
			{% assign disqus_id = site.xaymar.comments.disqus.identifier %}
		<div id="disqus_thread"></div>
		<script>
			var disqus_config = function () {
				this.page.url = "{{ disqus_url }}";
				this.page.identifier = "{{ disqus_page_url }}";
			};
			(function() { // DON'T EDIT BELOW THIS LINE
			var d = document, s = d.createElement('script');
			s.src = 'https://{{ disqus_id }}.disqus.com/embed.js';
			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>
		{% endif %}
	</div>
</div>
{% endif %}
