janboddez / share-on-mastodon

Easily share WordPress posts on Mastodon.
https://jan.boddez.net/wordpress/share-on-mastodon
GNU General Public License v3.0
39 stars 5 forks source link

Article title box not forming from link by default #41

Closed davehill47 closed 1 year ago

davehill47 commented 1 year ago

So normally Mastodon takes an URL in the post and creates (presumably from OG tags) a little title box like at the bottom of this:

sample post

(https://zirk.us/@WISTquote/109439721919308303)

But if I post via Share On Mastodon, that doesn't automatically happen. The URL is there, but no title box. I have to Edit the post, save it, and then the little title box shows up.

You mention "Mastodon is smart enough to then try and find things like an Open Graph image and description for that URL." So I'm thinking this should work, I just don't know why it doesn't.

In my add_filter 'share_on_mastodon_status', I generate the link through this code:

$status .= "Full quote, sourcing, notes: \n" . get_permalink( $post ) . "\n\n";

Am I doing something wrong (or expecting something weird), or is this actually an issue?

Thanks for this great plugin!

janboddez commented 1 year ago

Mastodon generates these preview cards in the background. If you just refresh the page, maybe after half a minute or so, it should be there.

davehill47 commented 1 year ago

Aha! A little experimentation and I find I stand completely corrected. I was most worried because there's some key info that gets conveyed through those preview cards and I was concerned I was going to need to replicate that data w/in the Mastodon post. Thanks!