commentit
commentit copied to clipboard
[Enhance] Add reply of comment feature
I integrate commentit in my personal blog, but I discover I can't reply to comment. I'm looking forward to add this feature. Thanks!
I asked myself how I could implement it.
First we need to implement a form that can popup when you click on a "reply" link on each comment.
Then in the data we have two options
- we add ID to comments, which makes it not retro-compatible. When a reply to a comment is sent, the ID of the comment is replied to is sent together.
- we base only of the order of comments. The order of the comment we reply to is sent along with the reply. We can use a dot-separated notation (such as 2.1 for first reply of second comment) to identify replies.
In first case 1, in the yaml data, we can add a field "reply-to" in comments which are replies. In case 2, we can just make a tree of comments in YAML data.
Because it is retro-compatible, I would more go on option 2, but please suggest any ideas. I will try to implement this month.