Skip to content

Commit

Permalink
update: speaker add social site links
Browse files Browse the repository at this point in the history
  • Loading branch information
tamascsaba committed Nov 16, 2023
1 parent df31d3c commit b61acbb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
1 change: 1 addition & 0 deletions 2023/src/data/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type SpeakerType = {
biographyJa: string
presentations: string[]
github: string
mastodon: string
twitter: string
location: string
}
Expand Down
3 changes: 3 additions & 0 deletions 2023/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ export default function IndexPage() {
biography
biographyJa
presentations
github
mastodon
twitter
}
}
}
Expand Down
27 changes: 21 additions & 6 deletions 2023/src/templates/speaker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,34 @@ export default function Speaker(props: Props) {
/>
<ResponsiveBox>
<Breadcrumb path={[{ label: t("speakers"), to: "/speakers" }, title]} />
{speakers.map((speaker, i) => (
<SpeakerBox key={speaker.uuid}>
<Avatar image={avatars[i]} alt={speaker.name} loading="eager" />
{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 <SpeakerBox key={speaker.uuid}>
<Avatar image={avatars[i]} alt={speaker.name} loading="eager"/>
<SpeakerSide>
<h1>
<SpeakerName speaker={speaker} />
<SpeakerName speaker={speaker}/>
</h1>
<Markdown>
{enOrJa(i18n)(speaker.biography, speaker.biographyJa)}
{biography}
</Markdown>
</SpeakerSide>
</SpeakerBox>
))}
})}
{sponsors.map(sponsor => (
<SpeakerBox key={sponsor.uuid}>
<SponsorLogo
Expand Down

0 comments on commit b61acbb

Please sign in to comment.