Hi,
If you don’t know utterances see how it looks here: https://www.danyow.net/
It’s awesome if you ask me. I tried to put it on my own blog and it does not work at the moment.
I’m following the setup guide here: https://utteranc.es/ Steps 1-2-3 are done.
Now I need to embed the script:
I insert the script in my post.hbs file like this:
I reload a post I have on my blog and I can see the script in the source code:
Nothing
Nothing is showing up
Any ideas?
technical stuff
Ayu
January 3, 2019, 5:40pm
2
I currently don’t see any script in your website’s source code.
Getting closer!
I looked in the source code of https://www.danyow.net/aurelia-custom-element-vs-compose/ . I saw this:
<!-- Enable comments / https://github.com/utterance/utterances -->
<script>
(function() {
if (location.pathname === '/') {
return;
}
var main = document.querySelector('main');
var script = document.createElement('script');
script.src='https://utteranc.es/client.js'
script.setAttribute('repo', 'pascalandy/pascalandy-site');
script.setAttribute('issue-term', 'pathname');
main.appendChild(script);
})();
</script>
The issue with this is that the comments are appearing in posts and pages. Of course, I would like to have the comments only within my posts :)
I guess at this point it’s only a question of formatting the script properly.
Oh you are right. It was gone as I was messing around. It’s back!
Ayu
January 3, 2019, 5:44pm
5
Post your post.hbs file here.
If you can’t then add that script of utterance after </footer> tag and under <section class="post-full-comments">
The repo attribute value should be in “owner/repo” format, rather than a full url to the repo.
repo=“pascalandy/pascalandy-site”
@Ayu You are right. Now it works!!
@jdanyow Ah! I missed this one. I would suggest to give a warning or an example
Solution
<section class="post-full-comments">
{{!-- Enable comments / https://github.com/utterance/utterances --}}
<script src="https://utteranc.es/client.js"
repo="pascalandy/pascalandy-site"
issue-term="pathname"
theme="github-light"
crossorigin="anonymous"
async>
</script>
</section>
from my post.hbs file:
1 Like
system
Closed
January 17, 2019, 5:59pm
8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.