Integrate

One line

<div id="comments"></div>
<script src="https://comments.example.com/embed.js" data-server="https://comments.example.com" defer></script>

The script reads data-server and mounts into #comments. post defaults to location.pathname, normalized the same way the server does.

Explicit mount

<div id="comments"></div>
<script src="https://comments.example.com/embed.js" defer></script>
<script>
  window.__gitCommentsAutoload = false
  window.addEventListener('DOMContentLoaded', () => {
    new Comments({
      server: 'https://comments.example.com',
      post: 'posts/hello-world',
      mount: '#comments',
    })
  })
</script>

Hugo

<div id="comments"></div>
<script src="https://comments.example.com/embed.js"
        data-server="https://comments.example.com"
        data-post="{{ .File.TranslationBaseName }}"
        defer></script>

Hexo

Add the same snippet to the post template and pass page.path as data-post.

Astro

<div id="comments"></div>
<script is:inline src="https://comments.example.com/embed.js"
        data-server="https://comments.example.com"
        data-post={Astro.url.pathname} defer></script>

Notes

  • server is the only required option; the widget never sees your repository or token
  • Styles live in Shadow DOM, isolated in both directions
  • Drafts (name, email, content) stay in localStorage and are cleared after a successful submit