{{- $scriptSrc := "https://utteranc.es/client.js" -}} {{- $issueTerm :=
.Page.Site.Params.comments.utterances.issueTerm -}} {{- $label :=
.Page.Site.Params.comments.utterances.label -}} {{- $username :=
.Page.Site.Params.comments.utterances.github.username -}} {{- $repository :=
.Page.Site.Params.comments.utterances.github.repository -}}

<script>
  // load comments
  let theme = "dark-blue";
  let script = document.createElement("script");
  script.src = "https://utteranc.es/client.js";
  script.setAttribute("repo", '{{ print $username "/" $repository }}');
  script.setAttribute("issue-term", "{{ $issueTerm }}");
  script.setAttribute("theme", theme);
  script.setAttribute("crossorigin", "anonymous");
  script.setAttribute("async", "");
  document.querySelector("div.comments").innerHTML = "";
  document.querySelector("div.comments").appendChild(script);
</script>
