mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
add site property to OpenGraphTemplateOpts
This commit is contained in:
parent
7e2217ccd8
commit
29d7495c39
1 changed files with 1 additions and 9 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
import { Storages } from '@/storages.ts';
|
|
||||||
import { NostrMetadata, NSchema as n } from '@nostrify/nostrify';
|
import { NostrMetadata, NSchema as n } from '@nostrify/nostrify';
|
||||||
import { getAuthor, getEvent } from '@/queries.ts';
|
import { getAuthor, getEvent } from '@/queries.ts';
|
||||||
import { getInstanceMetadata } from '@/utils/instance.ts';
|
|
||||||
import { nip05Cache } from '@/utils/nip05.ts';
|
import { nip05Cache } from '@/utils/nip05.ts';
|
||||||
import { match } from 'path-to-regexp';
|
import { match } from 'path-to-regexp';
|
||||||
import { nip19 } from 'nostr-tools';
|
import { nip19 } from 'nostr-tools';
|
||||||
|
|
@ -12,6 +10,7 @@ export interface OpenGraphTemplateOpts {
|
||||||
url: string;
|
url: string;
|
||||||
image?: StatusInfo['image'];
|
image?: StatusInfo['image'];
|
||||||
description: string;
|
description: string;
|
||||||
|
site: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PathParams = Partial<Record<'statusId' | 'acct' | 'note' | 'nevent' | 'nprofile' | 'npub', string>>;
|
export type PathParams = Partial<Record<'statusId' | 'acct' | 'note' | 'nevent' | 'nprofile' | 'npub', string>>;
|
||||||
|
|
@ -26,13 +25,6 @@ interface StatusInfo {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const store = await Storages.db();
|
|
||||||
|
|
||||||
export const getInstanceName = async () => {
|
|
||||||
const meta = await getInstanceMetadata(store, AbortSignal.timeout(1000));
|
|
||||||
return meta?.name || 'Ditto';
|
|
||||||
};
|
|
||||||
|
|
||||||
/** URL routes to serve metadata on. */
|
/** URL routes to serve metadata on. */
|
||||||
const SSR_ROUTES = [
|
const SSR_ROUTES = [
|
||||||
'/@:acct/posts/:statusId',
|
'/@:acct/posts/:statusId',
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue