Skip to content

Fix sprints page email and undefined title #1419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/components/SprintCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ const { data, body } = sprint;
<span class="text-gray-900">Contact:</span>
<span class="text-gray-700">{data.contactPerson.name}</span>
{data.contactPerson.email && (
<span class="text-gray-600">
{' '}(<a href={`mailto:${data.contactPerson.email}`} class="text-primary hover:text-primary-hover underline">{data.contactPerson.email}</a>)
<span class="text-primary">
{data.contactPerson.email.includes('@') ? (
<a href={`mailto:${data.contactPerson.email}`} class="hover:text-primary-hover underline">({data.contactPerson.email})</a>
) : (
<span>({data.contactPerson.email}) </span>
)}
</span>
)}
{data.contactPerson.github && (
Expand Down
2 changes: 1 addition & 1 deletion src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ const sprints = defineCollection({
pythonLevel: z.enum(["Any", "Beginner", "Intermediate", "Advanced"]),
contactPerson: z.object({
name: z.string(),
email: z.string().email().optional().nullable(),
email: z.string().optional().nullable(),
github: z.string().optional().nullable(),
twitter: z.string().optional().nullable(),
}),
Expand Down
2 changes: 1 addition & 1 deletion src/content/sprints/example_draft.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ numberOfPeople: "5"
pythonLevel: "Any"
contactPerson:
name: "Nikoś Hell"
email:
email: "nikoshell [at] example.com"
github: "nikoshell"
twitter: "nikoshell20"
links:
Expand Down
4 changes: 2 additions & 2 deletions src/pages/sprints.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { getCollection } from 'astro:content';
import { getEntry, render } from 'astro:content';
import { getEntry } from 'astro:content';
import Layout from '@layouts/MarkdownLayout.astro';
import SprintCard from '@components/SprintCard.astro';
import Markdown from "@ui/Markdown.astro";
Expand All @@ -22,7 +22,7 @@ const sprints = await getCollection("sprints", ({ data }) => {

---

<Layout title=`${entry.title}` description=`${entry.description}` toc=true>
<Layout title=`${entry.data.title}` description=`${entry.data.description}` toc=true>

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