<% if(theme.gitalk.clientID && theme.gitalk.clientSecret && theme.gitalk.repo){ %>
  <div id="gitalk-container"></div>
  <link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
  <script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.11.1/js/md5.min.js"></script>
  <script type="text/javascript">
    var gitalk = new Gitalk({
      clientID: '<%- theme.gitalk.clientID %>',
      clientSecret: '<%- theme.gitalk.clientSecret %>',
      repo: '<%- theme.gitalk.repo %>',
      owner: '<%- theme.gitalk.owner %>',
      admin: '<%- theme.gitalk.admin %>',
      id: md5(<%- theme.gitalk.id %>),
      language: '<%- theme.gitalk.language %>',
      perPage: '<%- theme.gitalk.perPage %>',
      pagerDirection: '<%- theme.gitalk.pagerDirection %>',
      createIssueManually: '<%- theme.gitalk.createIssueManually %>',
      distractionFreeMode: '<%- theme.gitalk.distractionFreeMode %>'
    });

    gitalk.render('gitalk-container')
  </script>
<% } %>