{{ if .Site.Params.enableGitalk }}
<div id="gitalk-container" class="gitalk-container"></div>
<link rel="stylesheet" href='{{ "css/gitalk.css" | absURL }}'>
<script src='{{ "js/gitalk.min.js" | absURL }}'></script>
<script>
  const gitalk = new Gitalk({
    clientID: '{{ .Site.Params.Gitalk.clientID }}',
    clientSecret: '{{ .Site.Params.Gitalk.clientSecret }}',
    repo: '{{ .Site.Params.Gitalk.repo }}',
    owner: '{{ .Site.Params.Gitalk.owner }}',
    admin: ['{{ .Site.Params.Gitalk.owner }}'],
    id: eval({{ .Site.Params.Gitalk.id }}), // Ensure uniqueness and length less than 50
    distractionFreeMode: false // Facebook-like distraction free mode
  });
  (function() {
    gitalk.render('gitalk-container');
  })();
</script>
{{ end }}