diff --git a/src/components/blog/BlogList.astro b/src/components/blog/BlogList.astro index d130c29..a34e593 100644 --- a/src/components/blog/BlogList.astro +++ b/src/components/blog/BlogList.astro @@ -72,80 +72,103 @@ const readMoreText = lang === 'zh' ? '阅读更多' : 'Read More'; ---
- {posts.map((post, index) => ( -
-
-
- {/* Featured Image */} -
- {post.title} -
-
- - {/* Content */} -
-
-

- - {post.title} - -

- -

- {post.description} -

- - {/* Tags */} -
- {post.tags.map((tag, tagIndex) => { - // 使用 tagId 如果存在,否则使用 tag 本身 - const tagRoute = post.tagId && Array.isArray(post.tagId) && tagIndex < post.tagId.length - ? post.tagId[tagIndex] - : tag.toLowerCase(); - - return ( - - # {tag} - - ); - })} -
+ {posts.length > 0 ? ( + posts.map((post, index) => ( +
+
+
+ {/* Featured Image */} +
+ {post.title} +
- {/* Meta Info */} -
-
- - - - - {post.date} - - {post.readTime} + {/* Content */} +
+
+

+ + {post.title} + +

+ +

+ {post.description} +

+ + {/* Tags */} +
+ {post.tags.map((tag, tagIndex) => { + // 使用 tagId 如果存在,否则使用 tag 本身 + const tagRoute = post.tagId && Array.isArray(post.tagId) && tagIndex < post.tagId.length + ? post.tagId[tagIndex] + : tag.toLowerCase(); + + return ( + + # {tag} + + ); + })} +
- - {readMoreText} - - - - + {/* Meta Info */} +
+
+ + + + + {post.date} + + {post.readTime} +
+ + + {readMoreText} + + + + +
-
-
- ))} +
+ )) + ) : ( +
+ + + +

+ {lang === 'zh' ? '暂无博客文章' : 'No blog posts yet'} +

+

+ {lang === 'zh' ? '我们正在努力创作新的内容,请稍后再来查看。' : 'We are working on creating new content. Please check back later.'} +

+ + + + + {lang === 'zh' ? '返回首页' : 'Back to Home'} + +
+ )}