diff --git a/apps/www/app/(marketing)/showcase/[...slug]/page.tsx b/apps/www/app/(marketing)/showcase/[...slug]/page.tsx index 34cdbc670..38cb52807 100644 --- a/apps/www/app/(marketing)/showcase/[...slug]/page.tsx +++ b/apps/www/app/(marketing)/showcase/[...slug]/page.tsx @@ -84,7 +84,7 @@ export default async function PagePage({ params }: PageProps) { diff --git a/apps/www/components/sections/showcase.tsx b/apps/www/components/sections/showcase.tsx index 7a434d399..e6f9630bb 100644 --- a/apps/www/components/sections/showcase.tsx +++ b/apps/www/components/sections/showcase.tsx @@ -5,6 +5,15 @@ import { ChevronRightIcon } from "@radix-ui/react-icons" import { showcaseSource } from "@/lib/source" import { Marquee } from "@/registry/magicui/marquee" +function isExternalHref(href: string) { + try { + const url = new URL(href) + return url.protocol === "http:" || url.protocol === "https:" + } catch { + return false + } +} + export interface ShowcaseCardProps { title: string image: string @@ -17,9 +26,13 @@ export function ShowcaseCard({ href, affiliation, }: ShowcaseCardProps) { + const isExternal = isExternalHref(href) return (