Skip to content

Commit

Permalink
feat: ad/sponsors images link to their ad
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Sep 23, 2024
1 parent 862436f commit ae32b40
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/data/sponsors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export const sponsorsBySlug = {
};

export const sponsorsByPlacement = _.groupBy(
Object.values(sponsorsBySlug),
Object.entries(sponsorsBySlug).map(([slug, sponsor]) => ({
slug,
...sponsor,
})),
(sponsor) => sponsor.placement,
);
14 changes: 8 additions & 6 deletions src/pages/ad/sponsors.astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ import "~/layouts/normalize.css";
Object.values(sponsorsByPlacement).map((sponsors) => (
<div class="sponsors-ad-list">
{sponsors.map((sponsor) => (
<Image
alt=""
class="ad-sponsor"
src={sponsor.logos.dark}
height={sponsor.placement === "first" ? 96 : 72}
/>
<a href={`/ad/sponsor/${sponsor.slug}`}>
<Image
alt={sponsor.title}
class="ad-sponsor"
src={sponsor.logos.dark}
height={sponsor.placement === "first" ? 96 : 72}
/>
</a>
))}
</div>
))
Expand Down

0 comments on commit ae32b40

Please sign in to comment.