Skip to content

Commit 8f81d4e

Browse files
committed
init publications homepage
1 parent 6432851 commit 8f81d4e

File tree

5 files changed

+40
-19
lines changed

5 files changed

+40
-19
lines changed

src/components/Event/Card.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const { title, card_image } = event;
1717
<Picture
1818
src={card_image.background}
1919
class="row-span-full col-span-full overflow-hidden p-4 grid items-center"
20+
widths={[300, 600, 900]}
2021
formats={['avif', 'webp']}
2122
alt={title ?? "Event card image"}
2223
/>
@@ -31,6 +32,7 @@ const { title, card_image } = event;
3132
<Picture
3233
src={card_image.foreground}
3334
class="row-span-full col-span-full overflow-hidden p-4 grid items-center"
35+
widths={[300, 600, 900]}
3436
formats={['avif', 'webp']}
3537
alt={title ?? "Event card image"}
3638
/>

src/components/Publication/Card.astro

Whitespace-only changes.

src/content/config.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -98,25 +98,6 @@ const profiles = defineCollection({
9898
}),
9999
});
100100

101-
/*
102-
title: HACKathon 2019
103-
series: fallctf
104-
description: SIGPwny's first recruiting CTF
105-
time_start: 2019-09-08T13:00:00.000-05:00
106-
time_close: 2019-09-08T18:00:00.000-05:00
107-
credit:
108-
- SIGPwny
109-
location: Siebel CS 1404
110-
card_image:
111-
background: hackathon-2019-cover.png
112-
links:
113-
- name: Writeup
114-
url: https://dillonkorman.com/running-sigpwnys-first-recruiting-ctf/
115-
- name: Opening Slides
116-
url: https://docs.google.com/presentation/d/1OQazs2_Ws2rXOn9rlmV2QxMDoxXQAtlEEiWeLienVu4/edit?usp=sharing
117-
stats: []
118-
*/
119-
120101
const events = defineCollection({
121102
type: 'content',
122103
schema: ({ image }) => z.object({
@@ -139,8 +120,30 @@ const events = defineCollection({
139120
}),
140121
});
141122

123+
const publications = defineCollection({
124+
type: 'content',
125+
schema: ({ image }) => z.object({
126+
title: z.string(),
127+
credit: z.array(z.string()),
128+
publisher: z.string(),
129+
publication_type: z.enum(['blog', 'paper', 'talk', 'news']),
130+
date: z.coerce.date(),
131+
card_image: z.optional(cardImageSchema(image)),
132+
primary_link: z.object({
133+
name: z.string(),
134+
url: z.string(),
135+
}),
136+
links: z.optional(z.array(z.object({
137+
name: z.string(),
138+
url: z.string(),
139+
}))),
140+
tags: z.optional(z.array(z.string())),
141+
}),
142+
});
143+
142144
export const collections = {
143145
'meetings': meetings,
144146
'profiles': profiles,
145147
'events': events,
148+
'publications': publications,
146149
};

src/pages/publications/[...slug]/index.astro

Whitespace-only changes.

src/pages/publications/index.astro

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
import Layout from '@/layouts/Base.astro';
3+
import { getCollection, type CollectionEntry } from "astro:content";
4+
5+
const rawPublications = await getCollection('publications') as CollectionEntry<'publications'>[];
6+
7+
---
8+
<Layout title="Publications">
9+
<h1>Publications</h1>
10+
<ul>
11+
{rawPublications.map((publication) => (
12+
<li>
13+
<a href={`/publications/${publication.slug}`}>{publication.data.title}</a>
14+
</li>
15+
))}
16+
</ul>

0 commit comments

Comments
 (0)