Trending
From 9f567e95937c8113da274cb856d83b7da4df3f7f Mon Sep 17 00:00:00 2001
From: Michael Moyles <93867352+MichaelMoyles@users.noreply.github.com>
Date: Fri, 11 Oct 2024 08:19:08 +0100
Subject: [PATCH 2/2] Fix Twitter( X.com ) card previews not displaying
correctly when sharing links (#1103)
---
app/(app)/articles/[slug]/page.tsx | 4 ++--
app/{api => }/og/route.tsx | 0
2 files changed, 2 insertions(+), 2 deletions(-)
rename app/{api => }/og/route.tsx (100%)
diff --git a/app/(app)/articles/[slug]/page.tsx b/app/(app)/articles/[slug]/page.tsx
index 508fa7a8..1a1e93e2 100644
--- a/app/(app)/articles/[slug]/page.tsx
+++ b/app/(app)/articles/[slug]/page.tsx
@@ -38,12 +38,12 @@ export async function generateMetadata({ params }: Props): Promise {
openGraph: {
description: post.excerpt,
type: "article",
- images: [`/api/og?title=${encodeURIComponent(post.title)}`],
+ images: [`/og?title=${encodeURIComponent(post.title)}`],
siteName: "CodĂș",
},
twitter: {
description: post.excerpt,
- images: [`/api/og?title=${encodeURIComponent(post.title)}`],
+ images: [`/og?title=${encodeURIComponent(post.title)}`],
},
alternates: {
canonical: post.canonicalUrl,
diff --git a/app/api/og/route.tsx b/app/og/route.tsx
similarity index 100%
rename from app/api/og/route.tsx
rename to app/og/route.tsx