Search code examples
javascriptgithubjekyllgithub-pagesblogs

Where do I paste Utterances <script> tag in Jekyll Minima theme?


I want to add comments on my Jekyll website with Utterances. I use Minima theme, so I don't have _layout/post.html.

I copied

<script src="https://utteranc.es/client.js"
        repo="sanchoi0310/comments"
        issue-term="pathname"
        theme="github-light"
        crossorigin="anonymous"
        async>
</script>

I thought I had to paste it in _site/index.html, but the comment window was not there and my <script> tag was automatically deleted.

Where do I paste Utterances <script> tag in Jekyll Minima theme?


Solution

  • Paste the code in the Default layout file. Also, you can create a layout for your page in _layouts file

    <script src="https://utteranc.es/client.js"
            repo="sanchoi0310/comments"
            issue-term="pathname"
            theme="github-light"
            crossorigin="anonymous"
            async>
    </script>