Skip to content

Commit 065614b

Browse files
committed
Fix sprints page email and undefined title
1 parent 2dc1ee4 commit 065614b

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

src/components/SprintCard.astro

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ const { data, body } = sprint;
3838
<span class="text-gray-900">Contact:</span>
3939
<span class="text-gray-700">{data.contactPerson.name}</span>
4040
{data.contactPerson.email && (
41-
<span class="text-gray-600">
42-
{' '}(<a href={`mailto:${data.contactPerson.email}`} class="text-primary hover:text-primary-hover underline">{data.contactPerson.email}</a>)
41+
<span class="text-primary">
42+
{data.contactPerson.email.includes('@') ? (
43+
<a href={`mailto:${data.contactPerson.email}`} class="hover:text-primary-hover underline">({data.contactPerson.email})</a>
44+
) : (
45+
<span>({data.contactPerson.email}) </span>
46+
)}
4347
</span>
4448
)}
4549
{data.contactPerson.github && (

src/content/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ const sprints = defineCollection({
265265
pythonLevel: z.enum(["Any", "Beginner", "Intermediate", "Advanced"]),
266266
contactPerson: z.object({
267267
name: z.string(),
268-
email: z.string().email().optional().nullable(),
268+
email: z.string().optional().nullable(),
269269
github: z.string().optional().nullable(),
270270
twitter: z.string().optional().nullable(),
271271
}),

src/content/sprints/example_draft.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ numberOfPeople: "5"
44
pythonLevel: "Any"
55
contactPerson:
66
name: "Nikoś Hell"
7-
email:
7+
email: "nikoshell [at] example.com"
88
github: "nikoshell"
99
twitter: "nikoshell20"
1010
links:

src/pages/sprints.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
import { getCollection } from 'astro:content';
3-
import { getEntry, render } from 'astro:content';
3+
import { getEntry } from 'astro:content';
44
import Layout from '@layouts/MarkdownLayout.astro';
55
import SprintCard from '@components/SprintCard.astro';
66
import Markdown from "@ui/Markdown.astro";
@@ -17,7 +17,7 @@ const sprints = await getCollection("sprints", ({ data }) => {
1717
1818
---
1919

20-
<Layout title=`${entry.title}` description=`${entry.description}` toc=true>
20+
<Layout title=`${entry.data.title}` description=`${entry.data.description}` toc=true>
2121

2222
<Markdown content={entry.body} />
2323
<div class="flex flex-wrap gap-8 justify-center my-8">

0 commit comments

Comments
 (0)