Add permalink to event description
This commit is contained in:
parent
5dbc337288
commit
a52447b31a
|
@ -8,6 +8,12 @@ import { getAllEvents } from "../lib/events";
|
|||
|
||||
export async function generateCalendar() {
|
||||
const events = await getAllEvents();
|
||||
const link = (link: string) =>
|
||||
`https://${path.join(
|
||||
"csclub.uwaterloo.ca",
|
||||
process.env.NEXT_PUBLIC_BASE_PATH ?? "",
|
||||
link
|
||||
)}`;
|
||||
|
||||
const calendar = ical({
|
||||
name: "University of Waterloo Computer Science Club",
|
||||
|
@ -21,18 +27,16 @@ export async function generateCalendar() {
|
|||
.replaceAll(":", "")
|
||||
.replaceAll(".", "")}@csclub.uwaterloo.ca`,
|
||||
summary: metadata.name,
|
||||
description: metadata.short,
|
||||
description: `${metadata.short} --- Learn more at ${link(
|
||||
metadata.permaLink
|
||||
)}`,
|
||||
start: new Date(metadata.date),
|
||||
end: addHours(new Date(metadata.date), 1),
|
||||
location: metadata.online
|
||||
? metadata.location
|
||||
: `University of Waterloo - ${metadata.location}`,
|
||||
organizer: "exec@csclub.uwaterloo.ca",
|
||||
url: `https://${path.join(
|
||||
"csclub.uwaterloo.ca",
|
||||
process.env.NEXT_PUBLIC_BASE_PATH ?? "",
|
||||
metadata.permaLink
|
||||
)}`,
|
||||
url: link(metadata.permaLink),
|
||||
})),
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue