{%- extends "layout.html" %}
{% set fa = ablog.fontawesome %}
{%- block extrahead %}
{{ super() }}
{% if feed_path %}
<link
  rel="alternate"
  type="application/atom+xml"
  href="{{ pathto(feed_path, 1) }}/atom.xml"
  title="{{ feed_title }}"
/>
{% endif %}
{% if ablog.fontawesome_link_cdn %}
<link href="{{ ablog.fontawesome_link_cdn }}" rel="stylesheet"/>
{% elif ablog.fontawesome_css_file %}
<link
  rel="stylesheet"
  href="{{ pathto('_static/' + ablog.fontawesome_css_file, 1) }}"
  type="text/css"
/>
{% endif %}
{% endblock %}
{% block body %}
{{ body }}
<div class="section ablog__blog_comments">
  {% if pagename in ablog %}
  {% include "ablog/postnavy.html" %}
  {% endif %}
  {% if ablog.disqus_shortname and ablog.blog_baseurl and (not ablog[pagename].nocomments) and ((pagename in ablog and (ablog[pagename].published or ablog.disqus_drafts)) or (not pagename in ablog and ablog.disqus_pages)) %}
  <div class="section ablog__comments">
    <h2>Comments</h2>
    <div id="disqus_thread"></div>
    <script type="text/javascript">
      var disqus_shortname = "{{ ablog.disqus_shortname }}";
      var disqus_identifier = "{{ablog.page_id(pagename)}}";
      var disqus_title = "{{title|e}}";
      var disqus_url = "{{ablog.page_url(pagename)}}";

      (function () {
        var dsq = document.createElement("script");
        dsq.type = "text/javascript";
        dsq.async = true;
        dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
        (
          document.getElementsByTagName("head")[0] ||
          document.getElementsByTagName("body")[0]
        ).appendChild(dsq);
      })();
    </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 >
  </div>
  {% endif %}
</div>
{% endblock %}
