10

I'm building a website using Docusaurus 2.

My website will contain docs and blogs. I wonder if it is possible to let visitors comment below an article?

I guess, if we support comments, we need an authentication system for the website too.

If the native Docusaurus does not support this, Is there any plugin to do so?

Yangshun Tay
  • 49,270
  • 33
  • 114
  • 141
SoftTimur
  • 5,630
  • 38
  • 140
  • 292

3 Answers3

6

Definitely. You can swizzle the doc pages and embed your own Disqus social plugin/Facebook comments plugin.

See this website for an example - https://www.banli17.com/docs/f2e/html/index/ of adding comments on pages via GitHub, which is a very cool idea! (Update Jul 5, 2020: the link is broken).

Find a tutorial here - https://coderhackers.com/blog/2020/02/29/how-to-add-forum-to-docusaurus (thanks @kirtan403)

Yangshun Tay
  • 49,270
  • 33
  • 114
  • 141
2

You can use swizzle to extract the component attached at the bottom of every page. It is DocItemFooter and here is a documentation for swizzling: https://docusaurus.io/docs/swizzling

I made a post about how to add a feedback widget in docusaurus here: https://happyreact.com/blog/feedback-widget-in-docusaurus It's not about adding a comment but it's a simple walkthrough how to use swizzle and add custom component that is attached to every page

Marcin
  • 71
  • 1
  • 5
0

Yes, you can swizzle a wrapper e.g. BlogPostItemWrapper for your blog posts using Giscus commenting system.

Check my blog post where you can test it live and find a step-by-step description of how to add Giscus, a commenting system powered by GitHub Discussions, to a static website generated by Docusaurus.

m19v
  • 1,800
  • 4
  • 11
  • 26
  • I think giscus only allows only github users to add comments? There is no oauth2 capability yet. – Oliver Nov 17 '22 at 04:09
  • From Giscus documentation: "To comment, visitors must authorize the giscus app to post on their behalf using the GitHub OAuth flow." I.e. You do authorize via GitHub. – m19v Nov 17 '22 at 13:13