Open taraskaduk opened 4 years ago
Found a solution, per @milesmcbain: https://milesmcbain.micro.blog/2020/09/04/how-i-got.html
An additional comment to this is that Miles' HTML script adds Utterances in between the post and the appendix. If one wanted to have the comments after the appendix, this would have to be reflected in HTML.
More specifically, in this line: var article = document.querySelector("d-appendix");
<script>
document.addEventListener("DOMContentLoaded", function () {
if (!/posts/.test(location.pathname)) {
return;
}
var script = document.createElement("script");
script.src = "https://utteranc.es/client.js";
script.setAttribute("repo", "your-github/your-repo");
script.setAttribute("issue-term", "og:title");
script.setAttribute("crossorigin", "anonymous");
script.setAttribute("label", "comment_thread");
/* wait for article to load, append script to article element */
var observer = new MutationObserver(function (mutations, observer) {
var article = document.querySelector("d-appendix");
if (article) {
observer.disconnect();
/* HACK: article scroll */
article.setAttribute("style", "overflow-y: hidden");
article.appendChild(script);
}
});
observer.observe(document.body, { childList: true });
});
</script>
@apreshill, I see your name in many of the issues recently, thought I'd tag you here. I closed this issue, but perhaps Utterances can be added to the documentation along with Disqus in the future. I provided all crucial info above.
Just a thought. I know that not everyone is hot on Disqus and their data collection.
Thank you @taraskaduk! Reopening to add to docs.
@apreshill thanks! I only closed it as I felt like there is already too many opened issues (that perhaps should be closed), and technically speaking, I was able to solve my issue in a roundabout way.
LMK if I can help here in any way that is productive.
Small update: there is now another option very similar to utterances for commenting on articles, giscus. It uses GitHub Discussions instead of Issues for storing comments. FYI, I wrote a blog post about how to use giscus with Distill.
Distill supports an easy addition of Disqus comments, as listed in the documentation:
This is the only mention of any comment engine in the documentation.
There exists an opinion (as voiced by Bob Rudis @hrbrmstr on Twitter, and later repeated by @maelle here) against Disqus.
Can more lightweight commenting engines (such as GitHub Utterances) be easily added to a Distill blog, and should this be reflected in the documentation?