FEP-8967: Generating link previews for attached links

It might not be the “shortest path”, but semantically there is a difference between directly attaching an Object versus indirectly attaching a Link. I think both should be possible. “Alternative approaches” covers this:

I do think it’s valuable to directly attach resources, but the processing model of many implementations doesn’t allow for this due to trust issues and assumptions made around JSON-LD availability of a resource. Given an attachment with an id, consumers may very well attempt to fetch the id with content negotiation and receive nothing (or HTML), which leads to an error state. In a trust model where claims are taken at face value (i.e. implicitly understood to be made by the author of the graph and not canonically by the resource definition), no such fetching need take place. But that’s not a model widely upheld on the fediverse. (It’s more popular in Semantic Web applications, where URIs are widely understood as symbols that anyone can use to say anything about anything.)

I’m not sure if this is exactly what you mean, but I’ve implemented a similar feature for mastodon recently (see two last commits on this branch and there’s a demo here)

@evan@cosocial.ca if we're putting Page or Article at the top level (of attachment, I think you mean?), that would suggest that every link preview be given an id and managed by the publisher. That suggests some level of responsibility over the link, and all I really want to do is just fire off a hyperlink.

So in the vast majority of cases, { attachment: [{ href: "..." }] } will do just fine, no?

Hey all!

I’m curious about something: would this let you embed games in a fediverse post?

There was a nifty hack you could do on Cohost that let you embed games using iframes with link previews. I can see why some people would not like it, but I think it would be a neat idea to share JavaScript/wasm games