Hashnode / starter-kit

A blog starter kit to use Hashnode as a Headless CMS using GraphQL APIs.
https://hashnode.com/headless
MIT License
501 stars 746 forks source link

Starter-kit: Comments not showing #120

Open Witomi opened 5 months ago

Witomi commented 5 months ago

Hi! I am just starting with the starter-kit for enterprise, and I am a bit confused of how to implement the comments, since I can see that there are files dedicated for comments, but when I am creating an article, it doesn't show the comment section (even though it is not disabled when publishing).

What should I do to enable it?

Harsh062 commented 3 months ago

Hi there!

Thank you for reaching out and using the starter-kit for your enterprise blog! Let's go through a couple of scenarios to understand why this might be happening:

Scenarios for the Comments Section Not Showing:

  1. Comments Disabled in Settings:

    • Normally, if comments are disabled during the publishing process, the comments section won't be rendered. Since you've mentioned that comments are not disabled, we can rule this out as a cause.
  2. No Comments on the Article:

    • The comments section is set to display only if there are existing comments on the article. The condition for rendering the comments section in the enterprise theme is:
      {!post.preferences.disableComments && post.comments.totalDocuments > 0 && <PostComments />}
    • This means that if there are no comments on the post yet (post.comments.totalDocuments is 0), the comments section won't appear.

If you have confirmed that the post has comments and you are still not seeing the comments section, we would need to investigate a bit deeper. Please provide the contents of your .env.local file so we can check for any misconfigurations or other issues that might be affecting the comments display.

Best regards,
Harsh

Harsh062 commented 3 months ago

Hi @Witomi, I hope you're doing well. I wanted to follow up on the above questions. Looking forward to your response.