From f8b333c70f727ceab30146b2601b776e2e4eb39d Mon Sep 17 00:00:00 2001 From: Robert Wagner Date: Wed, 22 Oct 2025 10:47:53 -0400 Subject: [PATCH] Attempt to improve LCP --- src/components/Dots.astro | 2 +- src/components/ShowArtwork.astro | 19 +++++++-- src/layouts/Layout.astro | 68 +++++++++++++++++++++++++++++++- 3 files changed, 83 insertions(+), 6 deletions(-) diff --git a/src/components/Dots.astro b/src/components/Dots.astro index bc8cf0d..aac74d6 100644 --- a/src/components/Dots.astro +++ b/src/components/Dots.astro @@ -1,3 +1,3 @@
-
+
diff --git a/src/components/ShowArtwork.astro b/src/components/ShowArtwork.astro index 9d60793..32d82d9 100644 --- a/src/components/ShowArtwork.astro +++ b/src/components/ShowArtwork.astro @@ -33,9 +33,20 @@ const { image } = Astro.props; diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index f14d496..407bdba 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -35,6 +35,35 @@ const { imageUrl, title } = Astro.props; const canonicalURL = Astro.props.canonicalURL ?? new URL(Astro.url.pathname, Astro.site); const description = Astro.props.description ?? starpodConfig.description; + +function extractDomain(url: string): string | null { + try { + return new URL(url).hostname; + } catch { + return null; + } +} + +function getExternalDomains(): string[] { + const domains = new Set(); + const siteHostname = Astro.site?.hostname; + + // Add RSS feed domain + const feedDomain = extractDomain(starpodConfig.rssFeed); + if (feedDomain && feedDomain !== siteHostname) { + domains.add(feedDomain); + } + + // Add image domain if it's external + const imageDomain = extractDomain(show.image); + if (imageDomain && imageDomain !== siteHostname) { + domains.add(imageDomain); + } + + return Array.from(domains); +} + +const externalDomains = getExternalDomains(); --- @@ -92,10 +121,45 @@ const description = Astro.props.description ?? starpodConfig.description; - + + + + { + externalDomains.map((domain) => ( + <> + + + + )) + } + + + {Astro.site && } + + + +
@@ -167,6 +232,7 @@ const description = Astro.props.description ?? starpodConfig.description;