Quick questions this evening... re: mentions
-
A quick one (hopefully) this evening...
Whenever I have a post with a mention, Mastodon likes to convert it into an attachment and display it in a preview box. Not sure what I'm doing different from other implementors to get this special treatment! I explicitly send
attachment: []
but to no avail...I had two questions, but I forget the second one now. Darn ADHD.
-
@julian Mastodon tries hard to generate a preview out of anything in any post that comes in from outside.
If I include a link, Mastodon generates a preview.
If I mention someone, Mastodon generates a preview of their account/channel.
If I post a URL in a code block, Mastodon generates a preview if that URL has a website behind it.
If I don't do anything, Mastodon generates a preview of my own channel.
#FediMeta #FediverseMeta #CWFediMeta #CWFediverseMeta #Mastodon #LinkPreview #LinkPreviews -
@julian mention links should have
u-url
class (and maybemention
too), and they should be wrapped into<span class="h-card">
element.hashtags should have
rel=tag
attribute -
Thanks both @[email protected] @[email protected]
That's annoying... Those attributes and classes are functionally useless to me, and I don't feel it would be right to add them just to achieve better compatibility with Mastodon... hmm...
The rel tag at least you could make a case for...
-
@julian @jupiter_rowland These classes are defined in microformats standard, so they are not Mastodon's invention and other implementations might also look for them when generating previews. Mastodon has documentation page with explanations: https://docs.joinmastodon.org/spec/microformats/
-
@[email protected] learned something new! Thanks for sharing that link. Looks like I'll be adding them then!
-
@[email protected] looks like all that's really needed is to add the
mention
class. It bothers me a bit because it's a functionally useless class for me, but I suppose it isn't strictly a mastodonism.I decided against adding microdata only because we already use Schema.org in NodeBB, so adopting a separate standard (even if they're mutually exclusive) would be a larger decision than one I want to make right now.