Why not, right?
I shipped a great bug yesterday. A big thanks to Chris Aldrich for catching that and sending me a DM today to let me know.
With all my cleverness around separating comment types for display below posts, I forgot to check for cases where there was some kind of Webmention, but no regul...
Remember that one of the hidden superpowers of the IndieWeb and particularly the wiki is that it is a great repository of documentation of prior artwork and web patterns for how others have designed and fixed various problems for themselves. Something like the wiki comments page may be helpful if you haven’t come across it.
I do like your idea of potentially not showing certain mention types in comment sections. I could see that as a feature that people would appreciate.
I hadn’t taken a close look at the IndieWeb comments documentation when I marked up the latest version of comments for this site last week. Today I’m going to follow some of the advice Chris had and stare closer at some prior art.
My first objective is to remove all of the unnecessary classes added to comments by WordPress through
comment_class(). To aid in helpful front-end styling, things likeodd,even,bypostauthor, and a handful of others are automatically added. I’m doing anything fancy, so I removed pretty much everything and went with a default ofclass="u-comment h-cite".Much of the markup around this has things like
u-likeandu-urlandh-citeand I knew there had to be some reasoning, but hadn’t bothered to actually dig in to what it all means. Today I found the documentation for microformat prefixes and everything makes a lot more sense. Go figure.This list is mostly a reproduction of the one on that page.
h-for root class names likeh-entryorh-citeu-for URL class names likeu-url. This makes the least immediate sense to me because I’m putting things likeu-likeandu-mentionat the<article>level rather the URLs it wraps, though that might be the intention—this container has URLs.dt-for datetime properties, which I use on the<time>element.p-for plain text.e-for element tree properties, or basically: contains HTML.I’m happy I spent some time actually staring at this. I’ve been “familiar” in the sense that I’ve used the markup for years, but I haven’t paid close enough attention to things like
p-ande-prefixes.My initial version of comments had the comment text wrapped in a
.comment-contentcontainer. I first switched that with.p-contenttoday before reading the prefix spec. Because I made the decision to add paragraph markup to webmention content and allow things like URLs, I decided.e-contentwould be the most accurate fit and switched things again.I then noticed a comment by Tantek on the IndieWeb comments page saying that
.h-entryis probably better for comments written on the actual site while.h-citeis best for comments that have a canonical location elsewhere. I went ahead and added a detection for “standard” comments and injected.h-entryfor those.WordPress’s comment type detection is um, yeah.
The
comment_typecolumn can be empty, “pingback”, or “trackback” by default. I think this column alone is probably the most annoying thing about even starting with comment types. I left a comment on the associated ticket along those lines.For now I assume comments that have no
comment_typeand have a meta key ofprotocolwith the valuewebmentionas added by the webmention plugin are in fact webmentions. Those use.h-citeand other comments with an emptycomment_typeuse.h-entry.Things are looking a bit cleaner in the source now, or at least making a bit more sense. I’m going to ship that and head over to watch some basketball and stew on why college athletics don’t have URLs to individual events. 🙄
I’ll plan on creating a post type this weekend that I can use for dedicated replies and likes. Sounds like a party. 🎉