Skip to content

Commit 017ae54

Browse files
committed
Start implementing outreach pages
1 parent 3bd55c4 commit 017ae54

File tree

4 files changed

+46
-7
lines changed

4 files changed

+46
-7
lines changed

src/components/Layout.astro

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ import Prose from '@/components/Prose.astro'
3737
href={`${import.meta.env.BASE_URL}/partnerships/`}>
3838
Partnerships
3939
</a>
40+
<a
41+
class="font-bold text-primary hover:bg-gray-100 transition p-4"
42+
class:list={[Astro.url.pathname.startsWith(`${import.meta.env.BASE_URL}/outreach/`) && 'underline']}
43+
href={`${import.meta.env.BASE_URL}/outreach/`}>
44+
Outreach
45+
</a>
4046
<a
4147
class="font-bold text-primary hover:bg-gray-100 transition p-4"
4248
class:list={[Astro.url.pathname.startsWith(`${import.meta.env.BASE_URL}/publications/`) && 'underline']}

src/layouts/Outreach.astro

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
---
22
import '@/styles/base.css'
3-
import Layout from '@/components/Layout.astro'
4-
const { frontmatter } = Astro.props
53
---
64

7-
<Layout>
8-
<div class="flex w-48 h-48 justify-center items-center"><img src={frontmatter.icon} class="max-w-48 max-h-48" /></div>
9-
<h1>{frontmatter.label}</h1>
10-
<slot />
11-
</Layout>
5+
<slot />

src/layouts/Outreachs.astro

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
import '@/styles/base.css'
3+
import Layout from '@/components/Layout.astro'
4+
const outreach = Object.values(import.meta.glob('@/pages/outreach/*.md', { eager: true })).filter(outreach => outreach.frontmatter.layout === '@/layouts/Outreach.astro')
5+
const dccs = Object.fromEntries(Object.values(import.meta.glob('@/pages/dccs/*.md', { eager: true })).filter(dcc => dcc.frontmatter.layout === '@/layouts/DCC.astro').map(dcc => [dcc.frontmatter.short_label, dcc]))
6+
---
7+
8+
<Layout>
9+
<slot/>
10+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
11+
{outreach.map(event =>
12+
<div class="flex flex-col justify-start items-stretch gap-2 p-8 shadow-md rounded-md">
13+
<div class="flex w-24 h-24 justify-center items-center"><img src={event.frontmatter.image} class="max-w-24 max-h-24" /></div>
14+
<h3>{event.frontmatter.title}</h3>
15+
<div class="overflow-ellipsis text-primary">
16+
<event.default />
17+
</div>
18+
{event.frontmatter.dcc && event.frontmatter.dcc.length > 0 &&
19+
<div class="flex flex-row flex-wrap items-center">
20+
<span class="font-bold text-primary">Hosted by:</span>
21+
{event.frontmatter.dcc.map(dcc => dccs[dcc]).map(dcc =>
22+
<a class="flex justify-center items-center p-2 hover:bg-gray-100" href={dcc.url}>
23+
<div class="w-16 h-16 flex justify-center items-center">
24+
<img class="max-w-16 max-h-16" src={dcc.frontmatter.icon} alt={dcc.frontmatter.short_label} />
25+
</div>
26+
</a>
27+
)}
28+
</div>
29+
}
30+
<div class="flex flex-row gap-8">
31+
{event.frontmatter.link && <a class="hanken-grotesk-500 text-primary hover:bg-gray-100 transition p-4" href={event.frontmatter.link} target="_blank">Visit Page</a>}
32+
</div>
33+
</div>
34+
)}
35+
</div>
36+
</Layout>

src/pages/outreach/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
layout: '@/layouts/Outreachs.astro'
3+
---

0 commit comments

Comments
 (0)