add site property to OpenGraphTemplateOpts

This commit is contained in:
Siddharth Singh 2024-08-05 15:43:56 +05:30
parent 7e2217ccd8
commit 29d7495c39
No known key found for this signature in database

View file

@ -1,7 +1,5 @@
import { Storages } from '@/storages.ts';
import { NostrMetadata, NSchema as n } from '@nostrify/nostrify';
import { getAuthor, getEvent } from '@/queries.ts';
import { getInstanceMetadata } from '@/utils/instance.ts';
import { nip05Cache } from '@/utils/nip05.ts';
import { match } from 'path-to-regexp';
import { nip19 } from 'nostr-tools';
@ -12,6 +10,7 @@ export interface OpenGraphTemplateOpts {
url: string;
image?: StatusInfo['image'];
description: string;
site: 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. */
const SSR_ROUTES = [
'/@:acct/posts/:statusId',