fix: update blog post URL handling to use API base URL instead of site URL

This commit is contained in:
Wini_Fy
2026-02-05 21:38:48 +07:00
parent 03263d5fb1
commit 0ae455f3d2
2 changed files with 5 additions and 8 deletions

View File

@@ -48,11 +48,11 @@ export async function generateMetadata({
const blogResponse = await fetchBlogDetail(slug);
const post = blogResponse.data;
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || "http://localhost:3000";
const url = `${siteUrl}/blog/${post.slug}`;
const apiUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3001";
const url = `${apiUrl}/blog/${post.slug}`;
const imageUrl = post.featuredImage
? getCmsImageUrl(post.featuredImage)
: `${siteUrl}/assets/img/inner-page/news-details/details-1.jpg`;
: `${apiUrl}/assets/img/inner-page/news-details/details-1.jpg`;
return {
title: post.title,