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

Post comments support #74

Open
GuilleAngulo opened this issue Oct 19, 2020 · 7 comments
Open

Post comments support #74

GuilleAngulo opened this issue Oct 19, 2020 · 7 comments
Labels
question Further information is requested

Comments

@GuilleAngulo
Copy link
Collaborator

Description

Should the site have support for post comments? Would be an interesting feature? I'm thinking as starting point it could be:

  • Adding this new field at Metadata (at PostCard) with the number of comments per post
  • Render comments details at post detail page.

It implies to add the count of comments at getAllPosts query, and comments data and lib files (to manage its own queries and functions). What do you think?

Screenshots

comments

@colbyfayock
Copy link
Owner

thats a good question! so my original thought was to not use the wordpress comment system with the idea being if someone wanted to implement comments, they may be better off using a more interactive clientside experience like Disqus or something

im certainly not opposed to it though and dont feel incredibly strongly about it. one consideration is if the comments were to be constantly up to date for an active site, the site would need to rebuild on each comment which would take a bit of time. another reason why a clientside dynamic experience might be better

thoughts? would also like to hear what @doingandlearning thinks

@GuilleAngulo
Copy link
Collaborator Author

GuilleAngulo commented Oct 20, 2020

I think you're right, comments are definitely a thing to be more interactive/dynamic. Seems like a much better option to leave the user implement Disqus, Commento, etc

Some other considerations/questions I was wondering also:
Would be interesting to give the option of that wordpress comment system support for those WP users that are already familiar with that system?(is an important and used feature among WP community?), Maybe using Next's Incremental Static Regeneration in order to rebuild only the post pages with new comments? Also, would this hypothetical support be better as a plugin for the starter rather than a native feature (in order to leave users to focus on alternatives like Disqus)?

@colbyfayock
Copy link
Owner

yeah let's hear what Kevin says, he's more in tune with the WordPress community than i am

that said, i want to explore the idea of plugins, but im not quite sure how the plugins would functionally work yet, as in, how would we "plug in" the functionality to the starter 🤔

@doingandlearning
Copy link
Collaborator

Sorry for the delay in weighing in on this, there are a few competing approaches here.

  • Leverage the WP comment system and use a graphql mutation to add them. For me, this breaks with the independence of the WP instance and I wouldn't vote for this approach.

  • Using a jamstack approach that potentially adds the comments and triggers a rebuild. The advantage here is that the comments stay with the blog content, which would seem to make sense. They'd be available on an SSR call to a page and would be indexable and crawlable (Phil Hawksworth has an interesting article about this approach here https://css-tricks.com/jamstack-comments/). This could require us building out some of this functionality and maybe leans on the more "opinionated" side.

  • Leverage a 3rd party like Disqus to handle the comments. Easy to swap in and out with different solutions but requires a separate call to the comment server and potentially wouldn't be indexed with the content (I think you'd probably not use serversideProps but initialProps or even a useEffect for this which may not append to the source html on first build)

I agree with @GuilleAngulo that having comment support would be good - I'm interested the Postlight don't seem to support comments out of the box (https://github.com/postlight/headless-wp-starter) - maybe this is an examples like implementation or a building blog that is easy to add or take away as desired?

There is a bit of controversy around headless WP and JAMstack at the moment and comments (or difficulty of them in the JAMstack) is one of the hot points.

@colbyfayock
Copy link
Owner

i like the idea of including it as an example when we start building all that out and @GuilleAngulo if you'd like to contribute to that you're more than welcome to, i would just make you an author in the WordPress instance i use for this project. we're going to make it a "blog-like" experience to showcase leveraging WordPress for the documentation site, so the example walk-through could be a blog post

@colbyfayock colbyfayock added the question Further information is requested label Oct 25, 2020
@GuilleAngulo
Copy link
Collaborator Author

Sure! Just to clarify: It would be a walk-through example (as a blog post) explaining how to add WP comment system support using graphql query/mutation, right?

@colbyfayock
Copy link
Owner

yeah so really it can be whatever you want! whether it's using the comment system or Disqus or something else

my ambitious goal would be to start a collection of these little posts that can help people get up and running with different setups revolving WordPress. For instance, I would imagine one post, whether Kevin or I writes it, could be about adding WPGraphQL to WordPress through the admin

no pressure :) just a nice way to provide some documentation, give an opportunity to write something, and use that as a way to test the project with its own content!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants