diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7414af9..f58734f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,9 +41,9 @@ Here's an example of what your entry might look like: // "description" is a short bio that will be shown on your profile page "description": "Haskell programmer, fanfiction author, and an omniscient unicorn.", - // Social usernames can include "twitter", "github", "linkedIn", - // "twitch", and "dribbble", as well as a "website" that can be - // anything you want! + // Social usernames can include "twitter", "github", "gitlab", + // "linkedIn", "twitch", "dribbble", "mastodon", "threads", and + // "youtube", as well as a "website" that can be anything you want! "socials": { "twitter": "UnicornUttrncs", "github": "unicorn-utterances", diff --git a/content/data/unicorns.json b/content/data/unicorns.json index 1dc54f19..bd74fe62 100644 --- a/content/data/unicorns.json +++ b/content/data/unicorns.json @@ -23,8 +23,11 @@ "lastName": "Fenn", "description": "Enjoys writing software on loud keyboards. Starts too many projects. Consumes food.", "socials": { - "twitter": "fennifith", - "github": "fennifith" + "github": "fennifith", + "twitch": "fennifith", + "mastodon": "https://is.a.horrific.dev/@fennifith", + "website": "https://jfenn.me", + "linkedIn": "james-fenn-3390b8167" }, "pronouns": "he/him", "profileImg": "./fennifith.jpg", diff --git a/src/icons/cohost.svg b/src/icons/cohost.svg new file mode 100644 index 00000000..762d0ce7 --- /dev/null +++ b/src/icons/cohost.svg @@ -0,0 +1 @@ + diff --git a/src/icons/gitlab.svg b/src/icons/gitlab.svg new file mode 100644 index 00000000..8ceab16c --- /dev/null +++ b/src/icons/gitlab.svg @@ -0,0 +1 @@ + diff --git a/src/types/UnicornInfo.ts b/src/types/UnicornInfo.ts index cd0fff5f..7256c103 100644 --- a/src/types/UnicornInfo.ts +++ b/src/types/UnicornInfo.ts @@ -9,10 +9,15 @@ export interface RawUnicornInfo { socials: { twitter?: string; github?: string; + gitlab?: string; website?: string; linkedIn?: string; twitch?: string; dribbble?: string; + mastodon?: string; + threads?: string; + youtube?: string; + cohost?: string; }; pronouns?: string; profileImg: string; diff --git a/src/utils/data.ts b/src/utils/data.ts index 5b3f6d39..ea5e559e 100644 --- a/src/utils/data.ts +++ b/src/utils/data.ts @@ -131,9 +131,33 @@ const fullUnicorns: UnicornInfo[] = unicornsRaw.map((unicorn) => { newUnicorn.socials.twitter = normalizeUsername(newUnicorn.socials.twitter); newUnicorn.socials.github = normalizeUsername(newUnicorn.socials.github); + newUnicorn.socials.gitlab = normalizeUsername(newUnicorn.socials.gitlab); newUnicorn.socials.linkedIn = normalizeUsername(newUnicorn.socials.linkedIn); newUnicorn.socials.twitch = normalizeUsername(newUnicorn.socials.twitch); newUnicorn.socials.dribbble = normalizeUsername(newUnicorn.socials.dribbble); + newUnicorn.socials.threads = normalizeUsername(newUnicorn.socials.threads); + newUnicorn.socials.cohost = normalizeUsername(newUnicorn.socials.cohost); + + // "mastodon" should be a full URL; this will error if not valid + try { + if (newUnicorn.socials.mastodon) + newUnicorn.socials.mastodon = new URL( + newUnicorn.socials.mastodon, + ).toString(); + } catch (e) { + console.error( + `'${unicorn.id}' socials.mastodon is not a valid URL: '${newUnicorn.socials.mastodon}'`, + ); + throw e; + } + + if (newUnicorn.socials.youtube) { + // this can either be a "@username" or "channel/{id}" URL, which cannot be mixed. + const username = normalizeUsername(newUnicorn.socials.youtube); + newUnicorn.socials.youtube = newUnicorn.socials.youtube.includes("@") + ? `https://www.youtube.com/@${username}` + : `https://www.youtube.com/channel/${username}`; + } return newUnicorn; }); diff --git a/src/views/unicorn/components/profile-section.astro b/src/views/unicorn/components/profile-section.astro index 6a520027..22d0e641 100644 --- a/src/views/unicorn/components/profile-section.astro +++ b/src/views/unicorn/components/profile-section.astro @@ -25,6 +25,11 @@ const socials = [ name: "GitHub", href: `https://github.com/${unicorn.socials.github}`, }, + unicorn.socials.gitlab && { + icon: "gitlab", + name: "GitLab", + href: `https://gitlab.com/${unicorn.socials.gitlab}`, + }, unicorn.socials.twitter && { icon: "twitter", name: "Twitter", @@ -45,6 +50,26 @@ const socials = [ name: "LinkedIn", href: `https://www.linkedin.com/in/${unicorn.socials.linkedIn}`, }, + unicorn.socials.mastodon && { + icon: "mastodon", + name: "Mastodon", + href: unicorn.socials.mastodon, + }, + unicorn.socials.threads && { + icon: "threads", + name: "Threads", + href: `https://www.threads.net/${unicorn.socials.threads}`, + }, + unicorn.socials.youtube && { + icon: "youtube", + name: "YouTube", + href: unicorn.socials.youtube, + }, + unicorn.socials.cohost && { + icon: "cohost", + name: "Cohost", + href: `https://cohost.org/${unicorn.socials.cohost}`, + }, ].filter((s) => !!s); --- @@ -81,6 +106,7 @@ const socials = [ socials.map((social) => (