From b61acbb711c097a38fca270782a2e1aab6c6b984 Mon Sep 17 00:00:00 2001 From: Csaba Tamas Date: Thu, 16 Nov 2023 18:41:55 +0100 Subject: [PATCH] update: speaker add social site links --- 2023/src/data/types.ts | 1 + 2023/src/pages/index.tsx | 3 +++ 2023/src/templates/speaker.tsx | 27 +++++++++++++++++++++------ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/2023/src/data/types.ts b/2023/src/data/types.ts index 8f2fd8005..b5cf71f1a 100644 --- a/2023/src/data/types.ts +++ b/2023/src/data/types.ts @@ -24,6 +24,7 @@ export type SpeakerType = { biographyJa: string presentations: string[] github: string + mastodon: string twitter: string location: string } diff --git a/2023/src/pages/index.tsx b/2023/src/pages/index.tsx index df336490b..98373454e 100644 --- a/2023/src/pages/index.tsx +++ b/2023/src/pages/index.tsx @@ -136,6 +136,9 @@ export default function IndexPage() { biography biographyJa presentations + github + mastodon + twitter } } } diff --git a/2023/src/templates/speaker.tsx b/2023/src/templates/speaker.tsx index 010ba52ee..8cbdde2a2 100644 --- a/2023/src/templates/speaker.tsx +++ b/2023/src/templates/speaker.tsx @@ -112,19 +112,34 @@ export default function Speaker(props: Props) { /> - {speakers.map((speaker, i) => ( - - + {speakers.map((speaker, i) => { + const socialLinks = [ + {account: speaker.github, site: 'github'}, + {account: speaker.mastodon, site: 'mastodon'}, + {account: speaker.twitter, site: 'twitter'} + ].filter(item => item.account).map((item) => { + let listItem = '' + if (item.site == 'github') listItem = `- Github: [${item.account}](https://github.com/${item.account})\n` + if (item.site == 'mastodon') listItem = `- Mastodon: [${item.account}](${item.account})\n` + if (item.site == 'twitter') listItem = `- Twitter: [${item.account}](https://twitter.com/${item.account})\n` + return listItem + }); + + const socialLinksMarkdown = '\n\n' + socialLinks.join('\n') + + const biography = enOrJa(i18n)(speaker.biography, speaker.biographyJa) + socialLinksMarkdown + return +

- +

- {enOrJa(i18n)(speaker.biography, speaker.biographyJa)} + {biography}
- ))} + })} {sponsors.map(sponsor => (