extension:link-previews
−Table of Contents
Link Previews
The Link Previews extension allows notes to include information about hyperlinks in the note's content. The information may be obtained in any way, but most likely via Open Graph tags and other similar metadata.
Schema
- array(object)
- url: url required
- siteName: string required
- title: string required
- description: string required
- style: “text” | “smallImage” | “largeImage”
- imageUrl: url optional
Notes
- You should only provide
style: “text”
ifimageUrl
is not present - You should not provide
style: “text”
ifimageUrl
is present - If you don't know the name of the site, a sensible fallback value for
siteName
would be the domain name of theurl
- Receiving instances might choose to show only some (or none!) of the link previews you send to them, so don't rely on them being visible, even if you expect everyone to support the extension
- Whether you trust the information provided in this extension (when coming from remote instances) is up to you. If you blindly trust it, you are susceptible to trivial spoofing (which may or may not be a problem), but if you ignore it and generate your own link previews you might accidentally place significant load on the website being linked to. A sensible compromise might be to use the information in this extension to begin with, and generate new previews later on (after a random delay) to spread the requests out from each instance and avoid inadvertently DDoSing the target site.
Example
{ "type": "note", ... "extensions": {"https://pawpub.entities.org.uk/extension/link-previews": [ { "url": "https://example.com/whatever", "siteName": "Example website", "title": "Whatever page!!", "description": "This is a description for the page", "style": "largeImage", // or smallImage or text "imageUrl": "https://example.com/whatever/preview.png" }, ... ]} }
extension/link-previews.txt · Last modified: 2025/03/22 15:14 by winter