Add documentation for `authors` attribute in preview cards (#1512)

* Add documentation for `authors` attribute in preview cards

* Add `PreviewCardAuthor` entity

* Update PreviewCard.md

* Update PreviewCardAuthor.md
This commit is contained in:
Claire 2024-08-23 17:34:28 +02:00 committed by GitHub
parent 54f7d5a63f
commit 24dd81ef49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 54 additions and 5 deletions

View File

@ -68,6 +68,7 @@ aliases: [
"title": "I lost my £193,000 inheritance with one wrong digit on my sort code",
"description": "When Peter Teichs money went to another Barclays customer, the bank offered £25 as a token gesture",
"type": "link",
"authors": [],
"author_name": "",
"author_url": "",
"provider_name": "",
@ -115,19 +116,28 @@ aliases: [
**Version history:**\
1.3.0 - added
### `authors` {#authors}
**Description:** Fediverse account of the authors of the original resource.\
**Type:** Array of [PreviewCardAuthor]({{< relref "entities/PreviewCardAuthor">}})\
**Version history:**\
4.3.0 - added
### `author_name` {#author_name}
**Description:** The author of the original resource.\
**Description:** The author of the original resource. Deprecated since 4.3.0, clients should use `authors` instead.\
**Type:** String\
**Version history:**\
1.3.0 - added
1.3.0 - added\
4.3.0 - deprecated
### `author_url` {#author_url}
**Description:** A link to the author of the original resource.\
**Description:** A link to the author of the original resource. Deprecated since 4.3.0, clients should use `authors` instead.\
**Type:** String (URL)\
**Version history:**\
1.3.0 - added
1.3.0 - added\
4.3.0 - deprecated
### `provider_name` {#provider_name}
@ -279,4 +289,4 @@ aliases: [
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/serializers/rest/trends/link_serializer.rb" caption="app/serializers/rest/trends/link_serializer.rb" >}}
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/models/trends/links.rb" caption="app/models/trends/links.rb" >}}
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/models/trends/links.rb" caption="app/models/trends/links.rb" >}}

View File

@ -0,0 +1,39 @@
---
title: PreviewCardAuthor
description: Represents an author in a rich preview card.
menu:
docs:
parent: entities
aliases: [
"/entities/PreviewCardAuthor",
]
---
## Attributes
### `name` {#name}
**Description:** The original resource author's name. Replaces the deprecated `author_name` attribute of the preview card.\
**Type:** String\
**Version history:**\
4.3.0 - added
### `url` {#url}
**Description:** A link to the author of the original resource. Replaces the deprecated `author_url` attribute of the preview card.\
**Type:** String (URL)\
**Version history:**\
4.3.0 - added
### `account` {{%nullable%}} {#account}
**Description:** The fediverse account of the author.\
**Type:** [Account]({{< relref "entities/Account">}})\
**Version history:**\
4.3.0 - added
## See also
{{< page-relref ref="entities/PreviewCard#authors" caption="PreviewCard (`authors` attribute)" >}}
{{< caption-link url="https://github.com/mastodon/mastodon/blob/main/app/serializers/rest/preview_card_serializer.rb" caption="app/serializers/rest/preview_card_serializer.rb" >}}