diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-07-01 00:03:34 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-07-01 00:03:34 -0700 |
| commit | fdbf92c95c5355136c38e958f6add37a8d242aa7 (patch) | |
| tree | 02ee4293deeaf65d20edf850abb2b58acab8efe9 | |
| parent | 89550dc39da5ccdb7e729c1dc2b68e5075980bd4 (diff) | |
adjust post link to use middleware site
| -rw-r--r-- | middleware/src/app/[gameName]/page.tsx | 4 | ||||
| -rw-r--r-- | 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<NewsFeedProps> = ({ 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)"); }} |
