fix news,

This commit is contained in:
Phuoc Nguyen
2025-11-11 11:34:23 +07:00
parent 47cdf71968
commit b5afeed534
12 changed files with 439 additions and 278 deletions

View File

@@ -86,12 +86,12 @@ class BlogPostModel {
}
}
// Extract excerpt from blogIntro or metaDescription
final excerpt = blogIntro ?? metaDescription ?? '';
// Use content_html preferentially, fall back to content
final htmlContent = contentHtml ?? content;
// Excerpt is ONLY from blog_intro (plain text)
final excerpt = blogIntro ?? '';
// Use meta image with full URL path
String imageUrl;
if (metaImage != null && metaImage!.isNotEmpty) {
@@ -117,7 +117,9 @@ class BlogPostModel {
return NewsArticle(
id: name,
title: title,
excerpt: excerpt.length > 200 ? '${excerpt.substring(0, 200)}...' : excerpt,
excerpt: excerpt.isNotEmpty
? (excerpt.length > 300 ? '${excerpt.substring(0, 300)}...' : excerpt)
: 'Không có mô tả',
content: htmlContent,
imageUrl: imageUrl,
category: category,