Skip to content

Commit 164d52c

Browse files
committed
Update sponsors links
1 parent 8e5dde5 commit 164d52c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/components/SponsorLogo.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const {
2020
} = sponsor.data;
2121
2222
const logo = sponsorLogos[sponsor.id];
23-
const slug = tier==="Partners"? `/community-partners#sponsor-${sponsorId}`: tier==="Platinum" ? `/sponsor/${sponsorId}` : tier==="Media Partners" ? `/media-partners#sponsor-${sponsorId}` : tier==="Startups" ? `/startups#sponsor-${sponsorId}` : `/sponsors#sponsor-${sponsorId}`
23+
const slug = tier==="Partners"? `/community-partners#sponsor-${sponsorId}`: tier==="Platinum" ? `/sponsor/${sponsorId}` : tier==="Media Partners" ? `/media-partners#sponsor-${sponsorId}` : tier==="Startups" ? `/startups#sponsor-${sponsorId}` : ""
2424
2525
---
2626

@@ -29,7 +29,7 @@ const slug = tier==="Partners"? `/community-partners#sponsor-${sponsorId}`: tier
2929
>
3030
<div class="w-full flex justify-center items-center md:items-center">
3131
{
32-
website ? (
32+
website && slug ? (
3333

3434
<a href={slug} aria-label={`Link to ${title}`}
3535
>

src/pages/sponsors.astro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import Button from "@ui/Button.astro";
77
88
import { slugify } from "@utils/content";
99
10-
const sponsors = await getCollection("sponsors");
10+
const sponsors = (await getCollection("sponsors", ({ data }) => {
11+
const isProd = import.meta.env.MODE === "production";
12+
const notDraft = !isProd || data.draft !== true;
13+
return notDraft ;
14+
})).sort((a, b) => a.id.localeCompare(b.id));
1115
1216
1317
const tiers = [

src/pages/startups.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ const sponsors = (await getCollection("sponsors", ({ data }) => {
2121
>
2222

2323
<Headline as="h1" id="startups" title="Startups" />
24+
{sponsors.length > 0 &&
2425
<p class="pb-5">
2526
EuroPython is a community-driven conference, and we wouldn’t be able to empower early-stage innovation and support emerging talent in the Python ecosystem without the generous support of our <strong>Startups</strong> tier sponsors. Learn more about them below (listed in alphabetical order).
2627
</p>
28+
}
2729
{sponsors.length > 0 && (
2830
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
2931
{sponsors.map((sponsor) => (

0 commit comments

Comments
 (0)