diff --git a/src/controllers/manifest.ts b/src/controllers/manifest.ts index a6b8c016..60e2a2ac 100644 --- a/src/controllers/manifest.ts +++ b/src/controllers/manifest.ts @@ -7,12 +7,19 @@ export const manifestController: AppController = async (c) => { const meta = await getInstanceMetadata(await Storages.db(), c.req.raw.signal); const manifest: WebManifestCombined = { + description: meta.about, + display: 'standalone', + icons: [{ + src: meta.picture, + sizes: '192x192', + }, { + src: meta.picture, + sizes: '512x512', + }], name: meta.name, + scope: '/', short_name: meta.name, start_url: '/', - display: 'standalone', - scope: '/', - description: meta.about, }; return c.json(manifest, { diff --git a/src/utils/instance.ts b/src/utils/instance.ts index 386c796f..244495a2 100644 --- a/src/utils/instance.ts +++ b/src/utils/instance.ts @@ -5,10 +5,11 @@ import { serverMetaSchema } from '@/schemas/nostr.ts'; /** Like NostrMetadata, but some fields are required and also contains some extra fields. */ export interface InstanceMetadata extends NostrMetadata { - name: string; about: string; - tagline: string; email: string; + name: string; + picture: string; + tagline: string; event?: NostrEvent; } @@ -31,6 +32,7 @@ export async function getInstanceMetadata(store: NStore, signal?: AbortSignal): about: meta.about ?? 'Nostr community server', tagline: meta.tagline ?? meta.about ?? 'Nostr community server', email: meta.email ?? `postmaster@${Conf.url.host}`, + picture: meta.picture ?? Conf.local('/images/avi.png'), event, }; }