mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 19:51:07 +02:00
fix: description generation logic
This commit is contained in:
parent
f17710bf29
commit
bc76861aab
2 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
title: 通用文章 Universal Article
|
title: 通用文章 Universal Article
|
||||||
published: 2025-03-24
|
published: 2025-03-24
|
||||||
lang: ''
|
# lang: ''
|
||||||
---
|
---
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
|
|
|
@ -69,6 +69,6 @@ export function generateDescription(
|
||||||
if (post.data.description)
|
if (post.data.description)
|
||||||
return 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)
|
return generateExcerpt(post.body, scene, lang)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue