feat: add opengraph tags

This commit is contained in:
Sam 2023-03-14 03:01:26 +01:00
parent 8cab186ee4
commit 97cce1d8fc
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
6 changed files with 117 additions and 2 deletions

View file

@ -111,6 +111,14 @@ export enum ErrorCode {
RequestTooBig = 4001,
}
export const pronounDisplay = (entry: Pronoun) => {
if (entry.display_text) return entry.display_text;
const split = entry.pronouns.split("/");
if (split.length < 2) return split.join("/");
else return split.slice(0, 2).join("/");
};
export const userAvatars = (user: User | MeUser | MemberPartialUser) => {
if (!user.avatar) return [];