-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Globalize more components, wip fall ctf events page
- Loading branch information
1 parent
09807cd
commit 090abbf
Showing
23 changed files
with
317 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
interface Props { | ||
year?: number; | ||
color?: string; | ||
} | ||
|
||
export default function FallCTFLogo({ year, color }: Props) { | ||
return ( | ||
<> | ||
<p className="font-bold text-8xl"> | ||
<span>Fall CTF</span> | ||
{year ? <span> {year}</span> : null} | ||
</p> | ||
</> | ||
) | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
import Layout from '@/layouts/Base.astro'; | ||
import Link from '$/components/Link.astro'; | ||
import { type CollectionEntry } from 'astro:content'; | ||
import { type HeadProps } from '$/components/BaseHead.astro'; | ||
import FallCTFLogo from '@/components/FallCTFLogo'; | ||
type Event = CollectionEntry<'events'>['data']; | ||
interface Props extends HeadProps { | ||
event: Event; | ||
}; | ||
const props: Props = Astro.props; | ||
const event = props.event; | ||
// const rawMeetings = (await getMeetings()).sort( | ||
// (a, b) => b.data.time_start.valueOf() - a.data.time_start.valueOf() | ||
// ); | ||
// type MeetingType = typeof rawMeetings[0]; | ||
// const meetingsBySemester = rawMeetings.reduce( | ||
// (acc, meeting) => { | ||
// const semester = meeting.data.semester; | ||
// if (acc[semester]) { | ||
// acc[semester].push(meeting); | ||
// } else { | ||
// acc[semester] = [meeting]; | ||
// } | ||
// return acc; | ||
// }, {} as {[semester: string]: MeetingType[]} | ||
// ); | ||
// const meetingSidebarItems = Object.keys(meetingsBySemester).map((semester) => ({ | ||
// name: formatSemester(semester), | ||
// items: meetingsBySemester[semester].map((meeting) => ({ | ||
// name: meeting.data.week_number != null ? `Week ${weekNumber(meeting.data.week_number)}: ${meeting.data.title}` : meeting.data.title, | ||
// url: meeting.slug, | ||
// active: meeting.slug === Astro.url.pathname, | ||
// })), | ||
// active: false | ||
// })); | ||
// // If a meeting is set as active, we also want to set the parent semester as active | ||
// meetingSidebarItems.forEach((semester) => { | ||
// semester.active = semester.items.some((meeting) => meeting.active); | ||
// }); | ||
--- | ||
|
||
<Layout {...props}> | ||
<section id="hero"> | ||
<div class="flex flex-col items-center"> | ||
<FallCTFLogo year={2024} /> | ||
<span class="flex flex-row gap-2"> | ||
{event.links.map((link) => ( | ||
<Link | ||
href={link.url} | ||
class="btn-primary font-bold border-2 border-surface-250" | ||
> | ||
{link.name} | ||
</Link> | ||
))} | ||
</span> | ||
</div> | ||
</section> | ||
<div class="flex flex-row gap-x-4"> | ||
<slot /> | ||
</div> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
import Layout from '@/layouts/Event.astro'; | ||
import { getCollection } from 'astro:content'; | ||
const page = (await getCollection('events', (event) => event.data.title === "Fall CTF 2024"))[0]; | ||
if (!page) { | ||
return Astro.error(404, 'Event not found'); | ||
} | ||
const event = page.data; | ||
--- | ||
<Layout | ||
event={event} | ||
title={event.title} | ||
description={event.description} | ||
> | ||
<div class="flex flex-col gap-4"> | ||
<details> | ||
<summary>What is a CTF?</summary> | ||
<span>CTF is an acronym for "capture-the-flag," which in the context of the cybersecurity field are competitions where teams solve security-related challenges to find a flag (usually a string of text). The flag can then be submitted to the competition platform for points, and the teams compete against each other for the most points!</span> | ||
</details> | ||
<details> | ||
<summary>How are tie-breakers determined?</summary> | ||
<span>The leaderboard is sorted first by the team with the most points. If teams have the same number of points, then the team who submitted their most recent flag earlier wins the tie-break.</span> | ||
</details> | ||
<details> | ||
<summary>How do I form a team?</summary> | ||
<span>By the day before the competition, we will be opening team registration on our competition platform. Feel free to find your team partner beforehand. We will also have multiple opportunities before and during the event to find and form teams!</span> | ||
</details> | ||
<details> | ||
<summary>I heard that there will be companies present. Do I need to dress up or prepare a resume?</summary> | ||
<span>We do not require a dress code and the expectation is that most people will be dressed casually. We will be offering a resume book to our sponsors and a resume PDF upload form will be provided during the event. If you need help preparing a resume, feel free to ask for advice in our Discord or take advantage of campus career resources!</span> | ||
</details> | ||
</div> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
import Layout from '@/layouts/Event.astro'; | ||
import { getCollection, render } from 'astro:content'; | ||
import Link from '$/components/Link.astro'; | ||
import { MdxComponents } from '$/components/Mdx/index.astro'; | ||
import FallCTFLogo from '@/components/FallCTFLogo'; | ||
import dayjs from 'dayjs'; | ||
import utc from 'dayjs/plugin/utc'; | ||
import timezone from 'dayjs/plugin/timezone'; | ||
import duration from 'dayjs/plugin/duration'; | ||
import advanced from 'dayjs/plugin/advancedFormat'; | ||
dayjs.extend(utc); | ||
dayjs.extend(timezone); | ||
dayjs.extend(duration); | ||
dayjs.extend(advanced); | ||
export async function getStaticPaths() { | ||
// filter to only fallctf events | ||
const events = (await getCollection('events', (event) => event.data.series === "fallctf")).sort( | ||
(a, b) => b.data.time_start.valueOf() - a.data.time_start.valueOf() | ||
); | ||
return events.map((event) => ({ | ||
params: { slug: dayjs(event.data.time_start).format('YYYY') }, | ||
props: { page: event }, | ||
})); | ||
}; | ||
const { page } = Astro.props; | ||
const { Content } = await render(page); | ||
const event = page.data; | ||
// const fallEvents = rawEvents | ||
// .filter(e => e.data.series === 'fallctf') | ||
// .sort((a, b) => new Date(b.data.time_start).getTime() - new Date(a.data.time_start).getTime()); | ||
// const [latestEvent, ...previousEvents] = fallEvents; | ||
const flavor = 'Fall CTF is a beginner-friendly CTF competition for UIUC students, designed to introduce students to cybersecurity topics.' | ||
--- | ||
<Layout | ||
event={event} | ||
title={event.title} | ||
description={event.description} | ||
> | ||
<section class="md-root w-full max-w-prose mx-auto"> | ||
<Content components={MdxComponents} /> | ||
</section> | ||
</Layout> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.