From a77175590755ba38c7507a64d862a39ab7dd0875 Mon Sep 17 00:00:00 2001 From: HangerThem Date: Tue, 4 Aug 2026 10:39:52 +0200 Subject: [PATCH] Fixed external link icon --- components/ui/ExternalLink.tsx | 10 ++++++++-- lib/posts.tsx | 2 -- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/ui/ExternalLink.tsx b/components/ui/ExternalLink.tsx index 480b57a..b46e2f7 100644 --- a/components/ui/ExternalLink.tsx +++ b/components/ui/ExternalLink.tsx @@ -1,3 +1,4 @@ +import { ExternalLinkIcon } from 'lucide-react' import type { AnchorHTMLAttributes } from 'react' type ExternalLinkProps = Omit< @@ -7,6 +8,11 @@ type ExternalLinkProps = Omit< href: string } -export function ExternalLink(props: ExternalLinkProps) { - return +export function ExternalLink({ children, ...props }: ExternalLinkProps) { + return ( + + {children} + + + ) } diff --git a/lib/posts.tsx b/lib/posts.tsx index 34eb11c..8bfa22a 100644 --- a/lib/posts.tsx +++ b/lib/posts.tsx @@ -26,7 +26,6 @@ import { rehypeDefinition } from '@/lib/rehype-definition' import { slugify } from '@/utils/slug' import { PostMeta } from '@/types/Post.type' import Link from 'next/link' -import { ExternalLinkIcon } from 'lucide-react' const postsDirectory = path.join(process.cwd(), 'content/posts') @@ -102,7 +101,6 @@ export async function getPostBySlug(slug: string, postDirectory: string = postsD href?.startsWith('http') ? ( {children} - ) : ( {children}