Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments features not showing properly #2655

Open
Dr-Left opened this issue Dec 3, 2024 · 2 comments
Open

Comments features not showing properly #2655

Dr-Left opened this issue Dec 3, 2024 · 2 comments
Labels
bug A bug.
Milestone

Comments

@Dr-Left
Copy link

Dr-Left commented Dec 3, 2024

Describe the bug
When I want to use comments providers, such as giscus, the page is not behaving as what I think. I can only see a “LEAVE A COMMENT” label at the bottom of the blog posts but no actual widgets.

To Reproduce
Follow the tutorial by Lazy Ren

Debugging
I believe the problem is that the _layouts/default.html doesn't include the /comments-providers/scripts.html.
I added {% include comments-providers/scripts.html %} to _includes/scripts.html and the problem is solved.
Is this a bug? If so I hope you could add the line to the file to solve this problem for others.

Before:
image

After:
image

@rjzupkoii rjzupkoii added the bug A bug. label Dec 3, 2024
@rjzupkoii rjzupkoii added this to the v0.9 milestone Dec 3, 2024
@rjzupkoii
Copy link
Collaborator

This does look like a bug, but there are other comment providers, so we would need to check to make sure adding /comments-providers/scripts.html to _layouts/default.html doesn't break things. Off-hand I suspect it would because the comments should only be rendering in places where they make sense such as the blog posts, as opposed to throughout the site, which edits to some of the default pages can tdo.

@Dr-Left
Copy link
Author

Dr-Left commented Dec 4, 2024

Yeah, I believe the code in /comments-providers/scripts.html take care of the problem you mentioned: only add comments section to blog posts, etc. instead of throughout the site. Check this line in /comments-providers/scripts.html:

{% if site.comments.provider and page.comments %}

If the _config.yaml does assign a true value to the comments field of a certain page, i.e. page.comments == true, then the comments section would appear; if not, it would not appear.

For me, the page I screenshot was a blog post page, which has the page.comments=true. After I performed my actions, the page behaved normally, with comments section only on certain pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug.
Projects
None yet
Development

No branches or pull requests

2 participants