Skip to content
Merged
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
38 changes: 25 additions & 13 deletions apps/site/src/components/CoverImage.astro
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,41 @@ const {
quality = 82,
sizes = "(max-width: 768px) 100vw, (max-width: 1280px) 50vw, 960px",
priority = false,
class: className = "w-full h-auto aspect-video rounded-md",
class: className = "w-full h-auto aspect-video rounded-md object-cover",
} = Astro.props;

const assetRef = stegaClean(
(image as { asset?: { _ref?: string } } | null)?.asset?._ref,
);
const dimMatch = assetRef?.match(/-(\d+)x(\d+)-[a-z0-9]+$/i);
const intrinsicWidth = dimMatch ? Number(dimMatch[1]) : undefined;

const builder = Astro.locals.sanity.urlForImage(image ?? undefined);
const aspect = height / width;
const isSquare = width === height;
const maxWidth = intrinsicWidth ? Math.min(width, intrinsicWidth) : width;
const maxHeight = Math.round(maxWidth * aspect);

const buildUrl = (w: number) => {
if (!builder) return undefined;
const b = builder.width(w);
return (isSquare ? b.height(Math.round(w * aspect)) : b)
.quality(quality)
.url();
};

const src = builder
?.width(width)
.height(height)
.quality(quality)
.url();
const src = buildUrl(maxWidth);

const responsiveWidths = [320, 480, 640, 960, 1280, 1600, 1920].filter(
(w) => w <= width,
(w) => w <= maxWidth,
);
if (!responsiveWidths.includes(width)) {
responsiveWidths.push(width);
if (!responsiveWidths.includes(maxWidth)) {
responsiveWidths.push(maxWidth);
}
const srcset = builder
? responsiveWidths
.map((w) => {
const h = Math.round(w * aspect);
const u = builder.width(w).height(h).quality(quality).url();
const u = buildUrl(w);
return `${u} ${w}w`;
})
.join(", ")
Expand All @@ -63,8 +75,8 @@ const alt = rawAlt && rawAlt.trim().length > 0 ? rawAlt : fallbackAlt;
class={className}
src={src}
srcset={srcset}
width={width}
height={height}
width={maxWidth}
height={maxHeight}
alt={alt}
loading={priority ? "eager" : "lazy"}
fetchpriority={priority ? "high" : "auto"}
Expand Down
59 changes: 0 additions & 59 deletions apps/site/src/components/PodmatchBadge.astro

This file was deleted.

4 changes: 0 additions & 4 deletions apps/site/src/lib/html-to-markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ export function htmlToMarkdown(html: string, pageUrl?: string): string {
/<div[^>]*class=["'][^"']*transcript-widget[^"']*["'][^>]*>[\s\S]*?<\/footer>\s*<\/div>\s*<\/div>\s*<\/div>/gi,
"",
)
.replace(
/<a[^>]*href=["']https:\/\/www\.podmatch\.com\/member\/codingcatdev["'][^>]*>[\s\S]*?<\/a>/gi,
"",
)
.replace(/<button\b[^<]*(?:(?!<\/button>)<[^<]*)*<\/button>/gi, "")
.replace(/<nav\b[^<]*(?:(?!<\/nav>)<[^<]*)*<\/nav>/gi, "")
.replace(/<header\b[^<]*(?:(?!<\/header>)<[^<]*)*<\/header>/gi, "")
Expand Down
6 changes: 2 additions & 4 deletions apps/site/src/pages/book.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
import Breadcrumbs from "@/components/Breadcrumbs.astro";
import PodmatchBadge from "@/components/PodmatchBadge.astro";
import BaseLayout from "@/layouts/BaseLayout.astro";
import { getMultiCalendarAvailableSlots } from "@/lib/google-calendar";

Expand Down Expand Up @@ -396,13 +395,12 @@ const description =
</div>
</div>

<!-- PodMatch Badge Footer -->
<!-- Footer -->
<footer class="flex flex-col sm:flex-row items-center justify-between gap-4 pt-8 border-t border-border">
<div class="flex flex-col gap-1 text-center sm:text-left">
<span class="text-xs font-semibold text-foreground">PodMatch Network Certified</span>
<span class="text-xs font-semibold text-foreground">CodingCat.dev Studio</span>
<span class="text-xs text-muted-foreground">Powered by CodingCat.dev &amp; Sanity Content Operating System</span>
</div>
<PodmatchBadge />
</footer>
</div>
</BaseLayout>
Expand Down
4 changes: 2 additions & 2 deletions apps/site/src/pages/contact.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const description =
<section>
<h2 class="text-2xl font-bold mt-8 mb-4">Podcast Guest Appearances</h2>
<p>
Interested in being a guest on the CodingCat.dev Podcast? We love spotlighting developers building exciting tools, open source libraries, and novel developer experiences. You can connect with us directly via email or through our official PodMatch profile at
<a href="https://www.podmatch.com/member/codingcatdev" target="_blank" rel="noopener noreferrer" class="text-primary hover:underline">PodMatch</a>.
Interested in being a guest on the CodingCat.dev Podcast? We love spotlighting developers building exciting tools, open source libraries, and novel developer experiences. You can connect with us directly via email at
<a href="mailto:alex@codingcat.dev" class="text-primary hover:underline">alex@codingcat.dev</a> or schedule a session on our <a href="/book" class="text-primary hover:underline">booking page</a>.
</p>
</section>

Expand Down
4 changes: 0 additions & 4 deletions apps/site/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
import AnimatedHero from "@/components/AnimatedHero.astro";
import HomeSection from "@/components/HomeSection.astro";
import PodmatchBadge from "@/components/PodmatchBadge.astro";
import BaseLayout from "@/layouts/BaseLayout.astro";
import type { ContentListItem } from "@/lib/content";
import { SITE_DESCRIPTION } from "@/lib/site";
Expand All @@ -26,9 +25,6 @@ const latestPosts = (home?.latestPosts ?? []) as ContentListItem[];
bare
>
<AnimatedHero />
<div class="flex justify-center -mb-8">
<PodmatchBadge />
</div>
<HomeSection
title="Latest Podcasts"
description="Check out our latest podcasts."
Expand Down
8 changes: 0 additions & 8 deletions apps/site/src/pages/podcast/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import CoverMedia from "@/components/CoverMedia.astro";
import FormattedDate from "@/components/FormattedDate.astro";
import PodcastListen from "@/components/PodcastListen.astro";
import PodcastPicks from "@/components/PodcastPicks.astro";
import PodmatchBadge from "@/components/PodmatchBadge.astro";
import PortableTextContent from "@/components/portable-text/PortableTextContent.astro";
import SectionHeader from "@/components/SectionHeader.astro";
import SponsorCard from "@/components/SponsorCard.astro";
Expand Down Expand Up @@ -168,9 +167,6 @@ const faqNode = faqSchema(extractFaqsFromPortableText(podcast.content));
<FormattedDate dateString={podcast.date} />
</div>
</div>
<div class="m-2 flex justify-center md:m-8">
<PodmatchBadge />
</div>
</div>

<PodcastListen
Expand Down Expand Up @@ -224,10 +220,6 @@ const faqNode = faqSchema(extractFaqsFromPortableText(podcast.content));
}
</article>

<div class="m-2 flex justify-center md:m-8">
<PodmatchBadge />
</div>

<PodcastPicks picks={podcast.pick} />

{
Expand Down
2 changes: 1 addition & 1 deletion apps/site/src/pages/privacy.astro
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const description =
<section>
<h2 class="text-2xl font-bold mt-8 mb-4">4. Third-Party Services</h2>
<p>
Our website may contain links to external websites, platforms, or services (such as YouTube, GitHub, PodMatch, X, and sponsor sites). We are not responsible for the privacy practices of external platforms. We encourage you to review the privacy policies of any third-party websites you visit.
Our website may contain links to external websites, platforms, or services (such as YouTube, GitHub, X, and sponsor sites). We are not responsible for the privacy practices of external platforms. We encourage you to review the privacy policies of any third-party websites you visit.
</p>
</section>

Expand Down
18 changes: 8 additions & 10 deletions apps/site/src/pages/sponsor/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ if (!sponsor?._id) {

const path = `/sponsor/${slug}`;
const origin = Astro.locals.siteUrl.origin;
const avatarUrl = sanity
const ogCardImageUrl = sanity
.urlForImage(sponsor.coverImage ?? undefined)
?.width(256)
.height(256)
.fit("crop")
?.width(640)
.url();
const rawExcerpt = sponsor.excerpt?.trim();
const description =
Expand All @@ -47,7 +45,7 @@ const relatedPodcasts = (sponsor.related?.podcast ?? []) as ContentListItem[];
title: sponsor.title,
subtitle: description,
type: "Sponsor",
avatar: avatarUrl,
image: ogCardImageUrl,
}}
canonical={path}
schema={[
Expand All @@ -62,14 +60,14 @@ const relatedPodcasts = (sponsor.related?.podcast ?? []) as ContentListItem[];
/>

<div class="flex w-full flex-col gap-4 md:gap-8">
<div class="flex gap-2 md:gap-8">
<div class="flex items-center gap-4 md:gap-8">
<div class="shrink-0">
<CoverMedia
image={sponsor.coverImage}
width={256}
height={256}
sizes="128px"
class="size-24 rounded-md object-cover md:size-32"
width={640}
height={360}
sizes="(max-width: 768px) 160px, 256px"
class="h-auto w-40 max-h-32 rounded-md object-contain md:w-64"
/>
</div>
<div class="flex flex-col gap-2">
Expand Down
Loading