mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-15 11:24:26 +01:00
Fallback to favicon.ico in link previews
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user