diff --git a/components/Footer.tsx b/components/Footer.tsx index 29e4b1c..4ae849a 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -3,6 +3,7 @@ import * as React from 'react' import { FaEnvelopeOpenText } from '@react-icons/all-files/fa/FaEnvelopeOpenText' import { FaGithub } from '@react-icons/all-files/fa/FaGithub' import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin' +import { FaMastodon } from '@react-icons/all-files/fa/FaMastodon' import { FaTwitter } from '@react-icons/all-files/fa/FaTwitter' import { FaYoutube } from '@react-icons/all-files/fa/FaYoutube' import { FaZhihu } from '@react-icons/all-files/fa/FaZhihu' @@ -63,6 +64,17 @@ export const FooterImpl: React.FC = () => { )} + {config.mastodon && ( + + + + )} + {config.zhihu && ( { + if (!mastodon) { + return null + } + + // Since Mastodon is decentralized, handles include the instance domain name. + // e.g. @example@mastodon.social + const url = new URL(mastodon) + return `${url.pathname.slice(1)}@${url.hostname}` +} + // default notion values for site-wide consistency (optional; may be overridden on a per-page basis) export const defaultPageIcon: string | null = getSiteConfig( 'defaultPageIcon', diff --git a/lib/site-config.ts b/lib/site-config.ts index 61552d5..b8c4fb6 100644 --- a/lib/site-config.ts +++ b/lib/site-config.ts @@ -16,6 +16,7 @@ export interface SiteConfig { newsletter?: string youtube?: string zhihu?: string + mastodon?: string; defaultPageIcon?: string | null defaultPageCover?: string | null diff --git a/site.config.ts b/site.config.ts index f17107c..4b82dc5 100644 --- a/site.config.ts +++ b/site.config.ts @@ -20,6 +20,7 @@ export default siteConfig({ twitter: 'transitive_bs', github: 'transitive-bullshit', linkedin: 'fisch2', + // mastodon: '#', // optional mastodon profile URL, provides link verification // newsletter: '#', // optional newsletter URL // youtube: '#', // optional youtube channel name or `channel/UCGbXXXXXXXXXXXXXXXXXXXXXX`