Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add opengraph properties to preview_url spec #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions scripts/add-opengraph-data-url-preview.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# add selected opengraph attributes to the preview_url_endpoint
diff --git a/data/api/client-server/authed-content-repo.yaml b/data/api/client-server/authed-content-repo.yaml
--- a/data/api/client-server/authed-content-repo.yaml (revision 1fc8f8856fe47849f90344cfa91601c984627acb)
+++ b/data/api/client-server/authed-content-repo.yaml (date 1727100324804)
@@ -348,6 +348,45 @@
format: uri
description: An [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris) to
the image. Omitted if there is no image.
+ og:title:
+ type: string
+ description: The title of your object as it should appear within the graph, e.g., "The Rock".
+ og:description:
+ type: string
+ description: A one to two sentence description of your object.
+ og:determiner:
+ type: string
+ description: |-
+ The word that appears before this object's title in a sentence.
+ An enum of (a, an, the, "", auto). If auto is chosen,
+ the consumer of your data should chose
+ between "a" or "an". Default is "" (blank).
+ og:locale:
+ type: string
+ description: |-
+ The locale these tags are marked up in. Of the format language_TERRITORY.
+ Default is en_US.
+ og:site_name:
+ type: string
+ description: |-
+ If your object is part of a larger web site,
+ the name which should be displayed for the overall site.
+ og:image:type:
+ type: string
+ description: The MIME type of the image, e.g., "image/png".
+ og:image:height:
+ type: integer
+ format: int64
+ description: The height of the image, in pixels.
+ og:image:width:
+ type: integer
+ format: int64
+ description: The width of the image, in pixels.
+ og:image:alt:
+ type: string
+ description: |-
+ A description of what is in the image (not a caption).
+ If the page specifies an og:image it should specify og:image:alt.
examples:
response:
value: {
3 changes: 3 additions & 0 deletions scripts/prepare_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ git apply ../scripts/one-time-keys-hack.patch

echo "Applying third party missing types patch"
git apply ../scripts/third-party-missing-type.patch

echo "Applying opengraph data url preview patch"
git apply ../scripts/add-opengraph-data-url-preview.patch
)
fi

Expand Down