diff --git a/src/components/Mention.astro b/src/components/Mention.astro index f501d42e02..dfb1d6f0ee 100644 --- a/src/components/Mention.astro +++ b/src/components/Mention.astro @@ -9,19 +9,24 @@ export type Props = { const { name } = Astro.props; const mention = await getEntry('authors', name); +if (!mention) { + return; +} + +const platform = mention.data.bluesky ? 'bluesky' : mention.data.twitter ? 'twitter' : 'mastodon'; +const linkUrl = mention.data[platform]; +const platformName = platform[0].toUpperCase() + platform.slice(1); + +const Tag = linkUrl ? 'a' : 'span'; --- -{ - mention && ( - - - - {mention.data.name} - - - ) -} + + + + {mention.data.name} + + diff --git a/src/components/Note.astro b/src/components/Note.astro index 96ade30e2d..0b25654b08 100644 --- a/src/components/Note.astro +++ b/src/components/Note.astro @@ -3,11 +3,27 @@ export interface Props { title?: string; } const { title } = Astro.props; + +const titleId = title?.replace(/[^\w]/g, '-').replace(/-+/g, '-').toLowerCase(); --- -