From 844c3fe59a81fb33bcdbf8db5a19c2f9c06cff11 Mon Sep 17 00:00:00 2001 From: Oscar Otero Date: Sun, 30 Jun 2024 12:33:28 +0200 Subject: [PATCH] speakers --- _includes/blocks.vto | 2 +- _includes/blocks/calendar/calendar.css | 39 ++++++++++++++++++++++++++ _includes/blocks/calendar/calendar.vto | 22 +++++++++++++++ _includes/blocks/calendar/fields.ts | 5 ++++ index.yml | 2 ++ 5 files changed, 69 insertions(+), 1 deletion(-) diff --git a/_includes/blocks.vto b/_includes/blocks.vto index 8974c55..b257a12 100644 --- a/_includes/blocks.vto +++ b/_includes/blocks.vto @@ -1,5 +1,5 @@
{{ for block of blocks }} - {{ include `./blocks/${block.type}/${block.type}.vto` { block } }} + {{ include `./blocks/${block.type}/${block.type}.vto` { block, blocks } }} {{ /for }}
diff --git a/_includes/blocks/calendar/calendar.css b/_includes/blocks/calendar/calendar.css index 457aaf2..9be7798 100644 --- a/_includes/blocks/calendar/calendar.css +++ b/_includes/blocks/calendar/calendar.css @@ -67,4 +67,43 @@ @media (width > 600px) { margin: 0 0 0 150px; } +} +.event-speakers { + list-style: none; + margin: 0; + padding: 1rem; + display: flex; + column-gap: 4rem; + row-gap: 2rem; + flex-wrap: wrap; + + @media (width > 600px) { + margin: 0 0 0 150px; + } + + button { + display: grid; + grid-template-columns: 100px 1fr; + align-items: center; + column-gap: 1rem; + padding: 1rem; + margin: 0; + border: none; + background: none; + border-radius: .5rem; + cursor: pointer; + max-width: 300px; + text-align: left; + + &:hover { + background-color: var(--color-light); + } + } + img { + width: 100%; + aspect-ratio: 1; + } + p { + margin: 0; + } } \ No newline at end of file diff --git a/_includes/blocks/calendar/calendar.vto b/_includes/blocks/calendar/calendar.vto index b165b4d..35371bc 100644 --- a/_includes/blocks/calendar/calendar.vto +++ b/_includes/blocks/calendar/calendar.vto @@ -26,6 +26,28 @@
{{ event.description |> md }}
+ + {{ if event.speakers }} + {{ set speakers = blocks + .filter((block) => block.type === "speakers") + .shift()?.speakers + .filter((speaker) => event.speakers.includes(speaker.id)) + }} + + + {{ /if }} {{ /for }} diff --git a/_includes/blocks/calendar/fields.ts b/_includes/blocks/calendar/fields.ts index c831335..868ea50 100644 --- a/_includes/blocks/calendar/fields.ts +++ b/_includes/blocks/calendar/fields.ts @@ -17,6 +17,11 @@ export default { "title: text", "subtitle: text", "description: markdown", + { + type: "list", + name: "speakers", + description: "Select the speakers ID for this event", + } ], }, ], diff --git a/index.yml b/index.yml index aa860a8..68c0043 100644 --- a/index.yml +++ b/index.yml @@ -99,6 +99,8 @@ blocks: title: Item de agenda subtitle: Subtítulo de item de agenda description: "Esperamos que no, la Tarugoconf Sofá Edition será única e irrepetible, como las circunstancias en las que se organiza y celebra, pero si este experimento sale bien, es probable que la Tarugo se convierta en un evento híbrido que pueda ser disfrutado presencialmente y desde casa.\r\n" + speakers: + - david-bonilla - title: 'Viernes, 15 de noviembre' events: - time: '9:00 - 12:00h'