@@ -28,6 +28,11 @@ export default class Article {
|
||||
return tag ? tag[1] : "Untitled";
|
||||
}
|
||||
|
||||
get image(): string {
|
||||
const tag = this.event.tags.find((t) => t[0] === "image");
|
||||
return tag ? tag[1] : undefined;
|
||||
}
|
||||
|
||||
get summary(): string {
|
||||
const tag = this.event.tags.find((t) => t[0] === "summary");
|
||||
return tag ? tag[1] : "";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { nip19, NostrEvent as NEvent } from "@nostr/tools";
|
||||
// import { NEvent } from "../nostr.ts";
|
||||
import config from "../config.ts";
|
||||
|
||||
export interface ProfileData {
|
||||
name?: string;
|
||||
@@ -54,4 +54,12 @@ export default class Profile {
|
||||
get npub(): string {
|
||||
return nip19.npubEncode(this.pubkey);
|
||||
}
|
||||
|
||||
get profileUrl(): string {
|
||||
return `${config.base_url}/@${this.username}`;
|
||||
}
|
||||
|
||||
get ogImageUrl(): string {
|
||||
return `${config.base_url}/assets/g/img/og-p-${this.event.id}.png`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user