{{ if .Params.enable_comments }}
<section class="full responsiveWidth">

  <article>
    <h1 id="comments"><i class="useless fas fa-comments"></i> Comments</h1>
      <div class="content" id='discourse-comments'></div>

      <script type="text/javascript">
        var eurl=window.location.href ;
        eurl=eurl.split("#")[0]; // Remove hash
        eurl=eurl.split("?")[0]; // Remove params        
        eurl=eurl.trim();// Remove whitespaces
        if(eurl.endsWith("/index.html"))eurl=eurl.substring(0,eurl.length-"/index.html".length).trim(); // Remove /index.html
        if(eurl.charAt(eurl.length-1)=="/") eurl=eurl.substring(0,eurl.length-1); // Remove ending /
        if(eurl.startsWith("http://")) eurl="https://"+eurl.substring("http://".length);        // Always use https        
        
        /// HACKFIX
        if(eurl.endsWith("/communitylog/new-website")){
          eurl+="/#content"; 
        }
        ///

        DiscourseEmbed = { 
          discourseUrl: 'https://hub.jmonkeyengine.org/',
          discourseEmbedUrl: eurl
        };
      
        (function() {
          var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
          d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
          (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
        })();
      </script>

</article>
</section>
{{end}}