From 397ddaf08e09f3421c246d3f7c1bd4f5e33149eb Mon Sep 17 00:00:00 2001 From: Niko Date: Mon, 30 Jun 2025 13:49:35 +0200 Subject: [PATCH 1/4] Add calendar component --- src/components/GoogleCalendar.astro | 60 +++++++++++++++++++++++++++++ src/pages/_test_components.astro | 18 ++++++--- 2 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 src/components/GoogleCalendar.astro diff --git a/src/components/GoogleCalendar.astro b/src/components/GoogleCalendar.astro new file mode 100644 index 000000000..2d0866a89 --- /dev/null +++ b/src/components/GoogleCalendar.astro @@ -0,0 +1,60 @@ +--- +// GoogleCalendar.astro +export interface Props { + calendarId?: string; + height?: string; + width?: string; + title?: string; + showTitle?: boolean; + showPrint?: boolean; + showTabs?: boolean; + showCalendars?: boolean; + showTz?: boolean; + mode?: 'WEEK' | 'MONTH' | 'AGENDA'; + backgroundColor?: string; +} + +const { + calendarId = "c_b87075b29cf4a9dd4da3fe724fcba92a4b406aa3f91cb7e7ce50fede43215b17@group.calendar.google.com", + height = "600", + width = "800", + title = "My Calendar", + showTitle = true, + showPrint = true, + showTabs = true, + showCalendars = true, + showTz = false, + mode = "MONTH", + backgroundColor = "%23ffffff" +} = Astro.props; + +// Construct the embed URL +const embedUrl = `https://calendar.google.com/calendar/embed?src=${encodeURIComponent(calendarId)}&ctz=Europe%2FPrague&mode=${mode}&height=${height}&wkst=2&bgcolor=${backgroundColor}&showTitle=${showTitle ? 1 : 0}&showPrint=${showPrint ? 1 : 0}&showTabs=${showTabs ? 1 : 0}&showCalendars=${showCalendars ? 1 : 0}&showTz=${showTz ? 1 : 0}`; + +// Mobile-specific embed URL for agenda view +const mobileEmbedUrl = `https://calendar.google.com/calendar/embed?src=${encodeURIComponent(calendarId)}&ctz=Europe%2FPrague&mode=AGENDA&height=400&wkst=2&bgcolor=${backgroundColor}&showTitle=0&showPrint=0&showTabs=0&showCalendars=0&showTz=0`; +--- + +
+ + + + + +
diff --git a/src/pages/_test_components.astro b/src/pages/_test_components.astro index c01c8bc38..3c593446e 100644 --- a/src/pages/_test_components.astro +++ b/src/pages/_test_components.astro @@ -1,9 +1,10 @@ --- -import Layout from "@layouts/Layout.astro"; +import Layout from "@layouts/SectionLayout.astro"; import Button from "@ui/Button.astro"; import Headline from "@ui/Headline.astro" import Icon from "@ui/Icon.astro" +import GoogleCalendar from '@components/GoogleCalendar.astro'; --- -
+ + + +Key Features
@@ -28,9 +39,7 @@ import Icon from "@ui/Icon.astro"
-
-
@@ -49,5 +58,4 @@ import Icon from "@ui/Icon.astro"
-
From 563308e1d04b739f26c144049795ce23d4cd0655 Mon Sep 17 00:00:00 2001 From: Niko Date: Mon, 30 Jun 2025 17:22:18 +0200 Subject: [PATCH 2/4] Add calendar for tests --- src/pages/_test_components.astro | 10 ---------- src/pages/calendar.astro | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 src/pages/calendar.astro diff --git a/src/pages/_test_components.astro b/src/pages/_test_components.astro index 3c593446e..69d2e253d 100644 --- a/src/pages/_test_components.astro +++ b/src/pages/_test_components.astro @@ -4,7 +4,6 @@ import Layout from "@layouts/SectionLayout.astro"; import Button from "@ui/Button.astro"; import Headline from "@ui/Headline.astro" import Icon from "@ui/Icon.astro" -import GoogleCalendar from '@components/GoogleCalendar.astro'; --- - - Key Features
diff --git a/src/pages/calendar.astro b/src/pages/calendar.astro new file mode 100644 index 000000000..95a0f2619 --- /dev/null +++ b/src/pages/calendar.astro @@ -0,0 +1,31 @@ + +--- +import Layout from "@layouts/SectionLayout.astro"; +import Button from "@ui/Button.astro"; +import Headline from "@ui/Headline.astro" +import Icon from "@ui/Icon.astro" +import GoogleCalendar from '@components/GoogleCalendar.astro'; +--- + + + + + + + + + + + + From 3e248347ea13a0cfedf0ee6cb5b0ec659692afa3 Mon Sep 17 00:00:00 2001 From: Niko Date: Fri, 4 Jul 2025 13:39:59 +0200 Subject: [PATCH 3/4] Add calendar to open spaces --- src/components/GoogleCalendar.astro | 8 +++++--- src/content/pages/{open-spaces.md => open-spaces.mdx} | 8 ++++++++ src/pages/[...slug].astro | 4 +++- src/pages/calendar.astro | 1 - 4 files changed, 16 insertions(+), 5 deletions(-) rename src/content/pages/{open-spaces.md => open-spaces.mdx} (96%) diff --git a/src/components/GoogleCalendar.astro b/src/components/GoogleCalendar.astro index 2d0866a89..2f7571552 100644 --- a/src/components/GoogleCalendar.astro +++ b/src/components/GoogleCalendar.astro @@ -12,6 +12,7 @@ export interface Props { showTz?: boolean; mode?: 'WEEK' | 'MONTH' | 'AGENDA'; backgroundColor?: string; + dates?: string; } const { @@ -25,14 +26,15 @@ const { showCalendars = true, showTz = false, mode = "MONTH", - backgroundColor = "%23ffffff" + backgroundColor = "%23000000", + dates = "20250714/20250720" } = Astro.props; // Construct the embed URL -const embedUrl = `https://calendar.google.com/calendar/embed?src=${encodeURIComponent(calendarId)}&ctz=Europe%2FPrague&mode=${mode}&height=${height}&wkst=2&bgcolor=${backgroundColor}&showTitle=${showTitle ? 1 : 0}&showPrint=${showPrint ? 1 : 0}&showTabs=${showTabs ? 1 : 0}&showCalendars=${showCalendars ? 1 : 0}&showTz=${showTz ? 1 : 0}`; +const embedUrl = `https://calendar.google.com/calendar/embed?src=${encodeURIComponent(calendarId)}&dates=${dates}&ctz=Europe%2FPrague&mode=${mode}&height=${height}&wkst=2&bgcolor=${backgroundColor}&showTitle=${showTitle ? 1 : 0}&showPrint=${showPrint ? 1 : 0}&showTabs=${showTabs ? 1 : 0}&showCalendars=${showCalendars ? 1 : 0}&showTz=${showTz ? 1 : 0}`; // Mobile-specific embed URL for agenda view -const mobileEmbedUrl = `https://calendar.google.com/calendar/embed?src=${encodeURIComponent(calendarId)}&ctz=Europe%2FPrague&mode=AGENDA&height=400&wkst=2&bgcolor=${backgroundColor}&showTitle=0&showPrint=0&showTabs=0&showCalendars=0&showTz=0`; +const mobileEmbedUrl = `https://calendar.google.com/calendar/embed?src=${encodeURIComponent(calendarId)}&dates=${dates}&ctz=Europe%2FPrague&mode=AGENDA&height=400&wkst=2&bgcolor=${backgroundColor}&showTitle=0&showPrint=0&showTabs=0&showCalendars=0&showTz=0`; ---
diff --git a/src/content/pages/open-spaces.md b/src/content/pages/open-spaces.mdx similarity index 96% rename from src/content/pages/open-spaces.md rename to src/content/pages/open-spaces.mdx index 4942bf48c..7b860159a 100644 --- a/src/content/pages/open-spaces.md +++ b/src/content/pages/open-spaces.mdx @@ -24,6 +24,14 @@ serves to attract potential participants interested in joining. Check the [Open Spaces schedule ↗️!](https://calendar.google.com/calendar/u/0?cid=Y19iODcwNzViMjljZjRhOWRkNGRhM2ZlNzI0ZmNiYTkyYTRiNDA2YWEzZjkxY2I3ZTdjZTUwZmVkZTQzMjE1YjE3QGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20) + + ## How to Organise an Open Space To organise your own Open Space session, simply book a free time slot and room diff --git a/src/pages/[...slug].astro b/src/pages/[...slug].astro index 062bddb90..d6e100f90 100644 --- a/src/pages/[...slug].astro +++ b/src/pages/[...slug].astro @@ -16,6 +16,7 @@ import Center from "@components/markdown/Center.astro"; import EPSLogo from "@components/markdown/EPSLogo.astro"; import ProfileCard from "@components/profile/ProfileCard.astro"; import SpeakerCard from "@components/profile/SpeakerCard.astro"; +import GoogleCalendar from '@components/GoogleCalendar.astro'; import Prose from "@ui/Prose.astro"; @@ -67,7 +68,8 @@ const description = post.data.subtitle; hr: Separator, Accordion, ProfileCard, - SpeakerCard + SpeakerCard, + GoogleCalendar }} /> diff --git a/src/pages/calendar.astro b/src/pages/calendar.astro index 95a0f2619..76681a38c 100644 --- a/src/pages/calendar.astro +++ b/src/pages/calendar.astro @@ -26,6 +26,5 @@ import GoogleCalendar from '@components/GoogleCalendar.astro'; mode="WEEK" showTitle={false} showPrint={false} - backgroundColor="%23f0f0f0" /> From 5cba4d9ab04cefa2a71cbb82f2cc2f4b430a01ac Mon Sep 17 00:00:00 2001 From: Niko Date: Fri, 4 Jul 2025 13:40:32 +0200 Subject: [PATCH 4/4] Remove example page --- src/pages/calendar.astro | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 src/pages/calendar.astro diff --git a/src/pages/calendar.astro b/src/pages/calendar.astro deleted file mode 100644 index 76681a38c..000000000 --- a/src/pages/calendar.astro +++ /dev/null @@ -1,30 +0,0 @@ - ---- -import Layout from "@layouts/SectionLayout.astro"; -import Button from "@ui/Button.astro"; -import Headline from "@ui/Headline.astro" -import Icon from "@ui/Icon.astro" -import GoogleCalendar from '@components/GoogleCalendar.astro'; ---- - - - - - - - - - - - -