-
Notifications
You must be signed in to change notification settings - Fork 3
Agregar sección de oradores plenarios en la home #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| --- | ||
| import { texts } from '@/i18n/home' | ||
| import SectionTitle from '../SectionTitle.astro' | ||
| import CenteredPanel from '../CenteredPanel.astro' | ||
| import type { ISpeaker } from '../../types/speakers' | ||
| import SpeakerCard from './SpeakerCard.astro' | ||
|
|
||
| const speakers = Object.values(import.meta.glob('../../data/speakers/*.md', { eager: true })) as { | ||
| frontmatter: ISpeaker | ||
| }[] | ||
|
|
||
| interface Props { | ||
| lang: string | ||
| } | ||
|
|
||
| const { lang } = Astro.props | ||
| const t = texts[lang as keyof typeof texts] | ||
|
|
||
| const sortedSpeakers = speakers.map((s) => s.frontmatter).sort((a, b) => a.order - b.order) | ||
| --- | ||
|
|
||
| { | ||
| sortedSpeakers.length > 0 && ( | ||
| <div class="flex flex-col items-center gap-6"> | ||
| <SectionTitle title={t['speakers.title']} /> | ||
| <CenteredPanel text={t['speakers.description']} /> | ||
|
|
||
| <ul class="w-full grid gap-8 md:grid-cols-2 lg:grid-cols-3 list-none m-0 p-0 mt-4"> | ||
| {sortedSpeakers.map((speaker) => ( | ||
| <li> | ||
| <SpeakerCard speaker={speaker} lang={lang} /> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| </div> | ||
| ) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| --- | ||
| import { Globe } from '@lucide/astro' | ||
| import type { ISpeaker, ISpeakerLink } from '../../types/speakers' | ||
| import { texts } from '../../i18n/home' | ||
| import { menuTexts } from '../../i18n/menu' | ||
| import SocialIcon from '../icons/SocialIcon.astro' | ||
|
|
||
| interface Props { | ||
| speaker: ISpeaker | ||
| lang: string | ||
| } | ||
|
|
||
| const { speaker, lang } = Astro.props | ||
| const t = texts[lang as keyof typeof texts] | ||
| const menuT = menuTexts[lang as keyof typeof menuTexts] | ||
|
|
||
| const altPhoto = t['speakers.altphoto'].replace('{name}', speaker.name) | ||
|
|
||
| function ariaForLink(link: ISpeakerLink, name: string): string { | ||
| const key = `speakers.aria_${link.type}` as | ||
| | 'speakers.aria_github' | ||
| | 'speakers.aria_linkedin' | ||
| | 'speakers.aria_instagram' | ||
| | 'speakers.aria_website' | ||
| const label = t[key] ?? link.type | ||
| return `${label.replace('{name}', name)} ${menuT.new_tab}` | ||
| } | ||
|
|
||
| const linkClasses = | ||
| 'inline-flex items-center justify-center w-9 h-9 rounded-full bg-white/[0.03] border border-white/[0.06] hover:bg-white/[0.08] hover:border-white/[0.15] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-pycon-yellow transition-colors' | ||
| --- | ||
|
|
||
| <article | ||
| class="h-full bg-pycon-black/40 p-8 rounded-2xl border border-white/5 hover:border-pycon-orange/50 transition-all motion-safe:hover:-translate-y-2 flex flex-col items-center text-center" | ||
| > | ||
| <img | ||
| src={speaker.photo} | ||
| alt={altPhoto} | ||
| width="160" | ||
| height="160" | ||
| loading="lazy" | ||
| class="rounded-full w-40 h-40 object-cover border-2 border-pycon-orange/30 mb-6" | ||
| /> | ||
|
|
||
| <h3 class="text-xl font-bold text-pycon-orange mb-4">{speaker.name}</h3> | ||
|
|
||
| <ul | ||
| aria-label={t['speakers.aria_social_links'].replace('{name}', speaker.name)} | ||
| class="flex items-center gap-3 list-none m-0 p-0 mb-4" | ||
| > | ||
| { | ||
| speaker.links.map((link) => ( | ||
| <li> | ||
| {link.type === 'website' ? ( | ||
| <a | ||
| href={link.url} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| aria-label={ariaForLink(link, speaker.name)} | ||
| class={linkClasses} | ||
| > | ||
| <Globe class="w-5 h-5" aria-hidden="true" focusable="false" /> | ||
| </a> | ||
| ) : ( | ||
| <a | ||
| href={link.url} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| aria-label={ariaForLink(link, speaker.name)} | ||
| class={linkClasses} | ||
| > | ||
| <SocialIcon platform={link.type} size="md" aria-hidden="true" /> | ||
| </a> | ||
| )} | ||
| </li> | ||
| )) | ||
| } | ||
| </ul> | ||
|
|
||
| <p class="text-sm leading-relaxed text-pycon-gray-25 whitespace-pre-line text-justify"> | ||
| {speaker.description} | ||
| </p> | ||
| </article> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| name: 'Ada Lovelace' | ||
| order: 1 | ||
| photo: '/speakers/ada-lovelace.webp' | ||
| links: | ||
| - type: 'github' | ||
| url: 'https://github.com/ada-lovelace' | ||
| - type: 'linkedin' | ||
| url: 'https://linkedin.com/in/ada-lovelace' | ||
| - type: 'website' | ||
| url: 'https://ada-lovelace.dev' | ||
| description: Pionera de la computación y primera programadora de la historia. Trabajó con Charles Babbage en la Máquina Analítica y escribió lo que se considera el primer algoritmo destinado a ser procesado por una máquina. Su visión de las computadoras como herramientas capaces de manipular símbolos, música y texto anticipó por más de un siglo los usos modernos de la informática. | ||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| export type TSpeakerLinkType = 'github' | 'linkedin' | 'instagram' | 'website' | ||
|
|
||
| export interface ISpeakerLink { | ||
| type: TSpeakerLinkType | ||
| url: string | ||
| } | ||
|
|
||
| export interface ISpeaker { | ||
| name: string | ||
| order: number | ||
| photo: string | ||
| links: ISpeakerLink[] | ||
| description: string | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.