Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions app/events.ics/route.ts
Original file line number Diff line number Diff line change
@@ -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);
}
2 changes: 1 addition & 1 deletion content/events/20230303-aec-hackathon-copenhagen.mdx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 14 additions & 2 deletions content/events/20240423-open-source-in-aec-copenhagen-event.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br />
Expand Down