From bc76861aab5ca31d28129e798fb17e1864b874a1 Mon Sep 17 00:00:00 2001 From: radishzzz Date: Mon, 24 Mar 2025 03:03:11 +0000 Subject: [PATCH] fix: description generation logic --- src/content/posts/Universal Article.md | 2 +- src/utils/description.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/posts/Universal Article.md b/src/content/posts/Universal Article.md index b8ed92f..853c0eb 100644 --- a/src/content/posts/Universal Article.md +++ b/src/content/posts/Universal Article.md @@ -1,7 +1,7 @@ --- title: 通用文章 Universal Article published: 2025-03-24 -lang: '' +# lang: '' --- ```markdown diff --git a/src/utils/description.ts b/src/utils/description.ts index 82e740e..dd67994 100644 --- a/src/utils/description.ts +++ b/src/utils/description.ts @@ -69,6 +69,6 @@ export function generateDescription( if (post.data.description) return post.data.description - const lang = post.data.lang ?? defaultLocale + const lang = (!post.data.lang || post.data.lang === '') ? defaultLocale : post.data.lang return generateExcerpt(post.body, scene, lang) }