aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-07-01 19:18:34 -0700
committerPinapelz <yukais@pinapelz.com>2025-07-01 19:18:34 -0700
commitd52479c162f4798a7630b8308949a21d72090fb5 (patch)
tree784e618999c82d3300b8f04355b4bf2783ff5ae1
parentaa2807d370cdd3d52c2af6cf3cfde3a9600807fb (diff)
middleware: allow for EN TL in opengraph
-rw-r--r--middleware/src/app/[gameName]/page.tsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/middleware/src/app/[gameName]/page.tsx b/middleware/src/app/[gameName]/page.tsx
index 5a4f0ff..dc070db 100644
--- a/middleware/src/app/[gameName]/page.tsx
+++ b/middleware/src/app/[gameName]/page.tsx
@@ -11,8 +11,8 @@ export async function generateMetadata({
const resolvedSearchParams = await searchParams;
let gameName = resolvedParams.gameName || "news";
const postId = resolvedSearchParams.post as string | undefined;
+ const lang = resolvedSearchParams.lang as string | undefined;
const apiUrlBase = process.env.NEXT_PUBLIC_API_URL;
- const mainNewsUrl = process.env.NEXT_PUBLIC_MAIN_NEWS_URL;
if (!postId) {
return {
@@ -42,6 +42,14 @@ export async function generateMetadata({
if (!matchingPost) {
return { title: "Post not found" };
}
+ if (lang === "en"){
+ if(matchingPost.en_headline !== null){
+ matchingPost.headline = matchingPost.en_headline;
+ }
+ if(matchingPost.en_content !== null){
+ matchingPost.content = matchingPost.en_content;
+ }
+ }
if (!matchingPost.headline) {
matchingPost.headline = matchingPost.content;
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage