Following a discussion that came up in Allow post creation from Friendica · Issue #2144 · LemmyNet/lemmy · GitHub
A problem that link aggregator style platforms run into is how to represent posting a link. The current de facto standard seems to be a
Page object with the
url field set to the link target. However, this doesn’t seem to be compatible with ActivityStreams definition of that field, since the url doesn’t point to a “representation of the object” but rather the object is often some sort of commentary on the link.
What structure should be used to cover this case?
My thought is that
tag would be a more fitting place to put this, as a Link object
Have a look at the definition of the
"name": "Omaha Weather Report",
So I guess that it is totally okay to use the
url here to point to a page.
This is different to the
"name": "What a Crazy Day I Had",
"content": "<div>... you will never believe ...</div>",
url isn’t mandatory for an
Article (but is for a
Page). It is widely used for the visual represantation of a
Article, but needn’t to be used at all.
The ‘url’ element can and should be be an array of different representations of (and different relations to) the selected object. There’s no reason this array couldn’t contain both a text/html representation and an application/activity+json representation with corresponding relations of ‘self’ (for instance). For media elements you might distinguish further based on dimensions.
Consuming applications only need to choose the flavours and relations and dimensions they are capable of consuming.
Page could make sense as a representation of the link itself, though that’s distinct from the “link post” which seems to me more like a Note that may be connected to that Page
Agreed - and in that case attachment is much better suited as I brought up recently in regards to the whole QuotedPost mess.
You would need a link to the HTML representation of the post. This could be
self. But which
rel would be suitable for the external link that is described with the
I don’t fully understand what you mean. Can you provide an example?
Here’s an example of what I’m calling a “link post”: Alternative web client for lotide: Luna
The post points to another page, but also has its own title and content
I still don’t understand. For me that post appears to me to have exactly the same structure like the
Page posts we talked about. I’m extremely bad in interpreting other people’s content.
Currently it is a Page but I don’t think that’s the right structure going forward since the post isn’t the page itself
@heluecht: I think the definition of
url is quite clear: “Identifies one or more links to representations of the object”. Thats not at all what we use it for in Lemmy now, we use the field for links to other websites (or images) which are discussed in the
Page. I also dont see any indication that the
link field has a different meaning in
Page, beside that example. And its just that, an example, not a definition.
So for me using
attachment field makes the most sense. I can certainly migrate Lemmy towards using that, although we will have to keep using
link field for some months for backwards compatibility. In the future it will then look like this:
Whar will you do when the attachment will contain multiple links? Or links to pictures? Or a combination of both?
For example a picture post looks like this:
"name": "Fischstäbchenpizza im Eisfach eines Supermarktes neben anderen Pizzen ",
I don’t oppose to the idea of using the
attachment, but when using that you should consider a full support.
attachment can be an array, I guess a system that only supports one attachment would just grab the first one? But yeah ideally it would do something more useful with the rest
Should we also add random links in the page/note/article content to the attachment array, or only the links explicitly specified by the author? If only the specified, a GNU social
Page will look like this:
"name": "hello, world. This is my first bookmark!",
"summary": "<p>This is the summary of a GNU social bookmark.</p>",
"content": "<p>This is the description. And it references <a href=\"https://duck.com\">DuckDuckGo></a> too.</p>",
"content": "This is the description. And it references [DuckDuckGo](https://duck.com) too.",
and this is rendered as:
<h1>hello, world. This is my first bookmark!</h1>
<a href="https://gnu.org" rel="noopener noreferrer">https://gnu.org</a>
<summary><p>This is the summary of a GNU social bookmark.</p></summary>
<p>This is the description. And it references <a href="https://duck.com">DuckDuckGo></a> too.</p>
For Lemmy it will only contain a single link which is specified explicitly by the author. I also didnt implement it as an array but a single value, though if all other implementations use an array, thats probably the better choice.
Edit: Changed to array for
attachment field now. For now Lemmy will always use the first item. In the future we could implement some smarter logic to select a link. Presenting multiple attached links to the user would be much more complicated, as it would require changes to database, api and frontend.
I think I would expect attachment to contain things that aren’t also specified in the content, maybe those could go into
tag, similar to mentions?
The url to the external resource needn’t to be part of the
content it can solely being used in
Concerning the content of the
attachment I suggest to also add the