mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 15:09:47 +00:00
✨ Add support for Mastodon link in footer
This commit is contained in:
@@ -55,12 +55,24 @@ export const language: string = getSiteConfig('language', 'en')
|
||||
|
||||
// social accounts
|
||||
export const twitter: string | null = getSiteConfig('twitter', null)
|
||||
export const mastodon: string | null = getSiteConfig('mastodon', null)
|
||||
export const github: string | null = getSiteConfig('github', null)
|
||||
export const youtube: string | null = getSiteConfig('youtube', null)
|
||||
export const linkedin: string | null = getSiteConfig('linkedin', null)
|
||||
export const newsletter: string | null = getSiteConfig('newsletter', null)
|
||||
export const zhihu: string | null = getSiteConfig('zhihu', null)
|
||||
|
||||
export const getMastodonHandle = (): string | null => {
|
||||
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',
|
||||
|
||||
@@ -16,6 +16,7 @@ export interface SiteConfig {
|
||||
newsletter?: string
|
||||
youtube?: string
|
||||
zhihu?: string
|
||||
mastodon?: string;
|
||||
|
||||
defaultPageIcon?: string | null
|
||||
defaultPageCover?: string | null
|
||||
|
||||
Reference in New Issue
Block a user