mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
webmanifest: add app icons
This commit is contained in:
parent
28e8dfb4ac
commit
5d484e4bf6
2 changed files with 14 additions and 5 deletions
|
|
@ -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, {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue