Skip to content
Advertisement

Jekyll: Comments.app widget does not show up on my page

I have simple jekyll blog where I would love to add comments.app widget.

Here is the code which I use to add the widget:

<h3>Comments:</h3>
<script async src="https://comments.app/js/widget.js?3"
    data-comments-app-website="{{ site.comments.commentsapp-id }}"
    data-limit="{{ site.comments.limit }}"
    data-color="39C4E8" 
    data-dark="1">
</script>
<noscript>
    Comments not available if Javascript is blocked. This is the only function of
    this website which needs Javascript.
</noscript>

the site.comments.commentsapp-id is stored in my _config.yml and it is placed correctly in rendered result.

But the widget does not show on page. What did I do wrong ?

Update: In inspect element option I discovered this:

<iframe id="comments-app-Kh5zcvkB-1" src="https://comments.app/embed/view?website=my-id&amp;page_url=%page/title%2F&amp;origin=https://my-site.com&amp;page_title=y-tittle&amp;limit=5&amp;color=39C4E8&amp;dark=1" scrolling="no" style="overflow: hidden; border: medium none;" width="100%" height="0" frameborder="0">
    <head></head><body>Page url invalid</body>
</iframe>

Advertisement

Answer

Finally solved this problem. It was caused by relative canonical URL in head of document.

So I replaced this:

<link rel="canonical" href="{{ page.url }}">

with this:

<link rel="canonical" href="{{ absolute_url }}">

Now it works fine.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement