forked from UKSOURCE/hailearning.edu.vn
fix: update blog post URL handling to use API base URL instead of site URL
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user