mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Fallback to favicon.ico in link previews
This commit is contained in:
parent
15c46ec3f0
commit
efc121a4ae
1 changed files with 2 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { Conf } from '@/config.ts';
|
||||
import { html } from '@/utils/html.ts';
|
||||
import { MetadataEntities } from '@/utils/og-metadata.ts';
|
||||
|
||||
|
|
@ -12,7 +13,7 @@ export function renderMetadata(url: string, { account, status, instance }: Metad
|
|||
const title = account ? `${account.display_name} (@${account.acct})` : instance.name;
|
||||
const attachment = status?.media_attachments?.find((a) => a.type === 'image');
|
||||
const description = status?.content || account?.note || instance.tagline;
|
||||
const image = attachment?.preview_url || account?.avatar_static || instance.picture;
|
||||
const image = attachment?.preview_url || account?.avatar_static || instance.picture || Conf.local('/favicon.ico');
|
||||
const siteName = instance?.name;
|
||||
const width = attachment?.meta?.original?.width;
|
||||
const height = attachment?.meta?.original?.height;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue