menu
up-caret
down-caret

Gatsby.js

Fast in every way that matters. Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps.

# Meta

Talk about the ecosystem, ask general questions about Gatsby or relevant tools. Please use #General for tech support.

Trending conversations
Share your stack...I'd love to see what you use the most in combo with Gatsby
@block-guy-eddie · 5d
Default pages directory
@selrond · 2h
"Shortcodes" Within Gatsby
@nickreese · 9d
Greater than operators in graphql?
@dakuan · 34d
Display GA Page Views data on website?
@techstacker · 1h

What's The Best Way to Make Commenting System

Wilbert Liu (@wilbertliu) · November 21, 2017 at 12:37am

What's The Best Way to Make Commenting System

November 21, 2017 at 12:37am (Edited 1 year ago)

Hello folks..,

I have a plan to make commenting system on my blog. Since Gatsby is a static site generator, is that possible to achieve that? If yes, what's the best way to achieve so?

Any kinds of direction will be appreciated.

Thanks!

Show previous messages

November 21, 2017 at 2:09am

check https://disqus.com/ it's super common

https://github.com/mzabriskie/react-disqus-thread

there's premade react component which you can embed in to your blog post template.

  • reply
  • like

Hey Necmettin @necmttn 👋🏻, thanks for that! 😀 Aside from the main topic, do you know how to make the "like" functionality as well? I mean, should I have back-end for this (with database setup) or is there easier way?

  • reply
  • like

disqus also provides like logic.

  • reply
  • like

if you want to use something else, yeah you would need back-end

  • reply
  • like

Interesting.. Thanks Necmettin, will consider that thoroughly. 🙏🏻

like-fill
1
  • reply
  • like

you're welcome.

like-fill
1
  • reply
  • like

November 21, 2017 at 3:35pm

Hey, if you're familiar with WordPress, it seems like it wouldn't take too much time to hook into their build-in commenting system.

  • reply
  • like

*built-in*

  • reply
  • like

It looks like you'd send a POST request through a form from your Gatsby site to your WP backend, which would have to have the 'post_id', 'author_name', and 'content'. There are other options that you could make required: http://v2.wp-api.org/reference/comments/

  • reply
  • like

I've build a plugin to hook into the 'save_post' action to send a POST request to an endpoint when a post is created, deleted, or updated. Using Netlify, you could have the site auto-rebuild: https://www.netlify.com/docs/webhooks/

  • reply
  • like

I think you'd need to modify my plugin (https://github.com/benforshey/JAMstack-WordPress) to also hook into the 'edit_post' action, because it looks like that's the one that WP fires when a comment is added or updated: https://codex.wordpress.org/Plugin_API/Action_Reference (search for "edit_post").

  • reply
  • like

And full disclaimer: I haven't build this. It just looks like it wouldn't be a huge amount of effort, since WP is providing all the backend infrastructure already.

  • reply
  • like

I updated my plugin to send POST notifications when comments were approved, unapproved, and deleted. If you template it out, you could have a pretty easy commenting system, I think. Still haven't built it myself, though. :-)

  • reply
  • like

November 22, 2017 at 2:34am

Hey Ben @benforshey, thank you so much for giving some insights! I'm not a WP fan, but will definitely consider this.. 😊👌🏻

like-fill
1
  • reply
  • like

Yeah, I really wasn't either until Gatsby v1. :-) But it's pretty awesome as a CMS (with a little tweaking).

  • reply
  • like

January 19, 2018 at 3:43am

Hello @wilbertliu and @necmttn and @benforshey, I built an open source commenting system for Gatsby. Here's a demo video & instructions: http://gatsby.demo.talkyard.io/demo-and-installation/.

What are your thoughts? Feedback please :-) if you have time.

What do you like about it? Or what's the main reason you would hesitate to use it?

If you want to use it and/or have questions, I'd be happy to help you. There's hosting too, if you don't want to provide your own server.

No ads, no tracking, & more lightweight than Disqus, + some new features (work in progress), see: https://www.effectivediscussions.org/-32/how-hacker-news-can-be-improved-3-things

like-fill
1
  • reply
  • like

I was gonna say Disqus is your best choice but Talkyard is awesome too. I think both can are good & there are many different alternatives I've found Googling but Gatsby is all about making your site fast so if you're using Comments, don't fetch it first. Just use a button below "Show All Comments" & then when someone clicks you can fetch all the comments. Whether its Disqus or something else. Also, if you want to learn something build your own 😉

  • reply
  • like

@deadcoder0904 if you see any benefits with Disqus that Talkyard maybe lacks, it'd be interesting to know about — maybe it's something I can improve.

Both Talkyard and Disqus load comments after the main page has loaded, so doesn't affect the initial load.

(B.t.w. if someone wants not just embedded comments, but a forum/chat/Q&A site next to the embedded blog coments, with the same logins, then that works with Talkyard.)

  • reply
  • like

Ohh that's good to know

  • reply
  • like

& awesome job on Talkyard

  • reply
  • like

January 24, 2018 at 1:56am

from mozilla, live on Washington Post now

like-fill
1
  • reply
  • like

July 31, 2018 at 4:03am

Updating that link, Kyle sent: https://coralproject.net/talk/

like-fill
1
  • reply
  • like

Can I update my Talkyard link above too — it's broken, was http but https required for it to work (& apparently cannot edit old comments here in Spectrum).

https://www.talkyard.io/blog-comments (better & different link)

& demo: https://www.kajmagnus.blog/new-embedded-comments (that's a Gatsby site)

  • reply
  • like
Show more messages