diff --git a/app/events.ics/route.ts b/app/events.ics/route.ts new file mode 100644 index 0000000..5e42404 --- /dev/null +++ b/app/events.ics/route.ts @@ -0,0 +1,35 @@ +import { NextResponse } from "next/server"; +import { createEvents, EventAttributes, ReturnObject } from "ics"; +import { getPosts } from "@opensource-construction/components"; + +const namespace = "events"; + +export async function GET(request: Request) { + const newHeaders = new Headers(request.headers); + newHeaders.set("Content-Type", "text/Calendar"); + newHeaders.set( + "Content-Disposition", + "inline; filename=opensource-construction.ics", + ); + + let events = getPosts(namespace).map((e) => { + let event = e.metadata.event; + event.title = e.metadata.title; + event.start = new Date(e.metadata.event.start).getTime(); + event.calName = "opensource.construction"; + event.url = `https://opensource.construction/events/${e.slug}`; + event.uid = `${e.slug}@opensource.construction`; + return event; + }); + let { error, value } = createIcsCalendarFromEvents( + events as EventAttributes[], + ); + if (error) { + throw new Error(`Calendar couldn't be created: ${error.name}`); + } + return new NextResponse(value, { headers: newHeaders }); +} + +function createIcsCalendarFromEvents(events: EventAttributes[]): ReturnObject { + return createEvents(events); +} diff --git a/content/events/20230303-aec-hackathon-copenhagen.mdx b/content/events/20230303-aec-hackathon-copenhagen.mdx index 12d4d5e..56a6d21 100644 --- a/content/events/20230303-aec-hackathon-copenhagen.mdx +++ b/content/events/20230303-aec-hackathon-copenhagen.mdx @@ -1,7 +1,7 @@ --- title: AEC Hackathon Copenhagen - 10.0 event: - start: 2023-03-03T16:00:00+01:00 + start: 2023-03-03T18:00:00+01:00 startInputType: utc duration: days: 2 diff --git a/content/events/20230316-open-source-for-architects-conference.mdx b/content/events/20230316-open-source-for-architects-conference.mdx index a457b8e..31d19a0 100644 --- a/content/events/20230316-open-source-for-architects-conference.mdx +++ b/content/events/20230316-open-source-for-architects-conference.mdx @@ -1,10 +1,10 @@ --- title: Open Source for Architects Conference event: - start: 2023-03-16T16:00:00+01:00 + start: 2023-03-16T13:00:00+01:00 startInputType: utc duration: - hours: 2 + hours: 4 --- ## Description diff --git a/content/events/20231101-kick-off-event-opensource-construction.mdx b/content/events/20231101-kick-off-event-opensource-construction.mdx index c197e8f..6526253 100644 --- a/content/events/20231101-kick-off-event-opensource-construction.mdx +++ b/content/events/20231101-kick-off-event-opensource-construction.mdx @@ -1,7 +1,7 @@ --- title: Kick-Off Event event: - start: 2024-04-23T16:00:00+01:00 + start: 2022-11-01T16:00:00+01:00 startInputType: utc duration: hours: 2 diff --git a/content/events/20240423-open-source-in-aec-copenhagen-event.mdx b/content/events/20240423-open-source-in-aec-copenhagen-event.mdx index e0eee13..4cd3349 100644 --- a/content/events/20240423-open-source-in-aec-copenhagen-event.mdx +++ b/content/events/20240423-open-source-in-aec-copenhagen-event.mdx @@ -5,22 +5,34 @@ event: startInputType: utc duration: hours: 2 - location: Bloxhub + location: Bloxhub, Bryghuspladsen 8, 1473 Copenhagen geo: lon: 55.6721040 lat: 12.5789120 - url: https://bloxhub.org/event/open-source-in-aec/ status: CONFIRMED organizer: name: Bloxhub + email: info@bloxhub.org dir: https://bloxhub.org attendees: - name: Victor Barbosa + email: events@openource.construction dir: https://www.linkedin.com/in/victorwanderley/ + rsvp: true + partstat: ACCEPTED + role: REQ-PARTICIPANT - name: Maxim Khomiakov + email: events@openource.construction dir: https://www.linkedin.com/in/maximkhv/ + rsvp: true + partstat: ACCEPTED + role: REQ-PARTICIPANT - name: Ernst von Stegmann + email: events@openource.construction dir: https://www.linkedin.com/in/ernstvonstegmann/ + rsvp: true + partstat: ACCEPTED + role: REQ-PARTICIPANT --- Sharing and learning are the drivers of radical innovation.