From fdbf92c95c5355136c38e958f6add37a8d242aa7 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Tue, 1 Jul 2025 00:03:34 -0700 Subject: adjust post link to use middleware site --- middleware/src/app/[gameName]/page.tsx | 4 ++-- site/src/components/NewsFeed.tsx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/middleware/src/app/[gameName]/page.tsx b/middleware/src/app/[gameName]/page.tsx index 8bf9c0b..76d883b 100644 --- a/middleware/src/app/[gameName]/page.tsx +++ b/middleware/src/app/[gameName]/page.tsx @@ -48,10 +48,10 @@ export async function generateMetadata({ } return { title: matchingPost.headline, - description: matchingPost.content.slice(0, 100), + description: matchingPost.content.slice(0, 300), openGraph: { title: matchingPost.headline, - description: matchingPost.content.slice(0, 100), + description: matchingPost.content.slice(0, 300), images: matchingPost.images?.[0]?.image ? [matchingPost.images[0].image] : [], diff --git a/site/src/components/NewsFeed.tsx b/site/src/components/NewsFeed.tsx index fe81148..62d4420 100644 --- a/site/src/components/NewsFeed.tsx +++ b/site/src/components/NewsFeed.tsx @@ -129,7 +129,8 @@ export const NewsFeed: React.FC = ({ newsItems }) => { href={`#${newsId}`} onClick={(e) => { e.preventDefault(); - const url = `${window.location.origin}${window.location.pathname}#${newsId}`; + const pathname = window.location.pathname === '/' ? '/news' : window.location.pathname.replace(/^\/game/, ''); + const url = `https://ac.moekyun.me${pathname}?post=${newsId}`; navigator.clipboard.writeText(url); alert("Copied Direct Link to Post (Older news are automatically culled after some time)"); }} -- cgit v1.2.3