Skip to content

Commit 3001a20

Browse files
committed
Add Numberly content.
1 parent 2187b97 commit 3001a20

32 files changed

+312
-140
lines changed

public/draft.png

14 KB
Loading

src/components/CardContent.astro

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
2-
2+
import { getEntry } from "astro:content";
33
import { marked } from 'marked';
4-
const { entry } = Astro.props;
5-
const html = entry && entry.body ? marked.parse(entry.body) : "";
4+
const { collection, entry:entryId } = Astro.props;
65
6+
const entry = await getEntry(collection, entryId);
7+
console.log(entryId)
8+
const html = entry && entry.body ? marked.parse(entry.body) : "";
79
810
---
911

10-
<div class="mb-2 prose prose-li:m-0 prose-ul:m-0 prose-ul:mb-2 prose-a:underline prose-h1:text-text prose-headings:font-title prose-headings:text-text prose-a:text-text hover:prose-a:text-primary-hover prose-strong:text-text prose-strong:font-bold prose-li:marker:text-text p-6">
11-
<article set:html={html} />
12-
</div>
12+
{ html &&
13+
<div class="mb-2 prose prose-li:m-0 prose-ul:m-0 prose-ul:mb-2 prose-a:underline prose-h1:text-text prose-headings:font-title prose-headings:text-text prose-a:text-text hover:prose-a:text-primary-hover prose-strong:text-text prose-strong:font-bold prose-li:marker:text-text p-6">
14+
<article set:html={html} />
15+
</div>
16+
}

src/components/JobCard.astro

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
---
22
import CardContent from "@components/CardContent.astro";
3-
const { job, sponsor } = Astro.props;
3+
import { getEntry } from "astro:content";
4+
const { job:jobId, sponsor:sponsorId } = Astro.props;
45
5-
// TODO: add tags
6-
const { title, location, type, level, salary, description, responsibilities, requirements, benefits, apply_link } = job.data;
6+
const job = await getEntry("jobs", jobId);
7+
if (!job) {
8+
throw new Error(`Job with ID "${jobId}" not found`);
9+
}
10+
11+
const sponsor = await getEntry("sponsors", sponsorId);
712
13+
if (!sponsor) {
14+
throw new Error(`Sponsor with ID "${sponsorId}" not found`);
15+
}
816
17+
// TODO: add tags
18+
const { title, location, type, level, salary, description, responsibilities, requirements, benefits, apply_link, draft } = job.data;
919
20+
const isJobPage = Astro.url.pathname == `/sponsor/${job.id}`;
1021
---
1122

12-
<div class="mb-6 last:mb-0">
13-
<div class="flex-1 p-6 rounded-lg shadow-md bg-white">
14-
<a href={`/sponsor/${job.id}`}>
23+
<div class="mb-6 last:mb-0 rounded-lg shadow-md bg-white">
24+
<div class=`flex-1 p-6 ${draft ? "draft": ""}`>
25+
<a href={`/sponsor/${jobId}`}>
1526
<h2 class="text-3xl font-bold mb-2">{title}</h2>
1627
</a>
1728

@@ -23,7 +34,7 @@ const { title, location, type, level, salary, description, responsibilities, req
2334
<p class="text-gray-600 mb-2">{level}{type}{location}</p>
2435
}
2536
<p class="text-gray-700 mb-4">{salary}</p>
26-
<p class="mb-6">{description}</p>
37+
<p class="mb-3">{description}</p>
2738

2839
{ responsibilities &&
2940
<h3 class="text-xl font-semibold mb-2">Responsibilities</h3>
@@ -46,9 +57,6 @@ const { title, location, type, level, salary, description, responsibilities, req
4657
</ul>
4758
}
4859

49-
50-
<CardContent entry={job} />
51-
5260
<a
5361
href={apply_link}
5462
target="_blank"
@@ -84,4 +92,5 @@ const { title, location, type, level, salary, description, responsibilities, req
8492
color: var(--color-primary-hover);
8593
text-decoration: underline;
8694
}
95+
8796
</style>

src/components/SponsorCard.astro

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
import { type CollectionEntry, getEntry } from "astro:content";
33
import { Image } from "astro:assets";
44
import { sponsorLogos } from "@data/sponsorLogos";
5-
65
import Icon from "@ui/Icon.astro";
76
8-
const { sponsor, showJobs=false } = Astro.props;
7+
const { sponsor: sponsorId, showJobs=false } = Astro.props;
8+
const sponsor = await getEntry("sponsors", sponsorId);
9+
10+
if (!sponsor) {
11+
throw new Error(`Sponsor with ID "${sponsorId}" not found`);
12+
}
13+
914
const {
1015
name: title,
1116
url: website,
@@ -14,6 +19,7 @@ const {
1419
description,
1520
socials,
1621
logo_padding = false,
22+
draft
1723
} = sponsor.data;
1824
1925
const jobFiles = import.meta.glob("../content/sponsors/*/!(index).md");
@@ -49,9 +55,9 @@ const socialLinks = [
4955
---
5056

5157
<div
52-
class="lg:max-w-[400px] flex flex-col gap-6 p-6 rounded-lg shadow-md bg-white text-black mb-6"
58+
class=`lg:max-w-[400px] flex flex-col gap-6 p-6 rounded-lg shadow-md bg-white text-black mb-6 ${draft ? "draft": "no-draft"}`
5359
>
54-
<div class="w-full flex justify-center items-center md:items-center min-h-[140px]">
60+
<div class="w-full flex justify-center items-center md:items-center min-h-[140px] ">
5561
{
5662
logo && (
5763
<Image
@@ -121,6 +127,7 @@ const socialLinks = [
121127
{socialLinks
122128
.filter((link) => socials?.[link.key])
123129
.map((link) => {
130+
if (!socials) return;
124131
const url = socials[link.key];
125132
let iconColor:string;
126133

src/components/SponsorDisplay.astro

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
---
2+
import { getEntry } from "astro:content";
23
import { Image } from "astro:assets";
3-
const { sponsor } = Astro.props;
4+
const { sponsor: sponsorId } = Astro.props;
5+
6+
7+
const sponsor = await getEntry("sponsors", sponsorId);
8+
9+
if (!sponsor) {
10+
throw new Error(`Sponsor with ID "${sponsorId}" not found`);
11+
}
12+
413
514
import { sponsorDisplay } from "@data/sponsorDisplay";
615
const image = sponsorDisplay[sponsor.id]

src/components/SponsorLogo.astro

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
---
2+
import { getEntry } from "astro:content";
23
import { Image } from "astro:assets";
34
import { sponsorLogos } from "@data/sponsorLogos";
45
5-
const { sponsor } = Astro.props;
6+
const { sponsor: sponsorId } = Astro.props;
7+
8+
9+
const sponsor = await getEntry("sponsors", sponsorId);
10+
11+
if (!sponsor) {
12+
throw new Error(`Sponsor with ID "${sponsorId}" not found`);
13+
}
14+
615
const {
716
name: title,
817
url: website,

src/content/config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ const sponsors = defineCollection({
210210
bluesky: z.string().url().optional().nullable(),
211211
})
212212
.optional(),
213-
jobs: z.array(z.string()).optional(),
214213
logo_padding: z.string().optional(),
214+
draft: z.boolean().optional().default(false),
215+
jobs: z.array(reference("jobs")).optional().default([]),
215216
}),
216217
});
217218

@@ -229,6 +230,8 @@ const jobs = defineCollection({
229230
requirements: z.array(z.string()).nullable(),
230231
benefits: z.array(z.string()).nullable(),
231232
apply_link: z.string().url().optional(),
233+
draft: z.boolean().optional().default(false),
234+
sponsor: reference("sponsors").optional(),
232235
}),
233236
});
234237

src/content/sponsors/1password/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ socials:
1717
bluesky:
1818
tier: Supporters
1919
logo_padding: 30px 10px
20+
draft: true
2021
---
2122

2223
## About 1Password

src/content/sponsors/1password/intern.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ benefits:
2323
- "Exposure to cybersecurity innovation."
2424
- "Mentorship from industry experts."
2525
apply_link: "https://1password.com/careers"
26+
draft: true
2627
---

src/content/sponsors/1password/product-design-intern.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ benefits:
2323
- "Opportunity to shape products used by millions."
2424
- "Access to 1Password’s design community."
2525
apply_link: "https://1password.com/careers"
26+
draft: true
2627
---

0 commit comments

Comments
 (0)