Skip to content

Commit

Permalink
Merge pull request #1839 from milvus-io/feat/make-keep-reading-no-empty
Browse files Browse the repository at this point in the history
feat: make keep reading never empty
  • Loading branch information
shanghaikid authored Feb 10, 2025
2 parents 5d69ac6 + ae0e5e6 commit 3d5ab11
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/localization/CreateBlogDetailProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ export const createBlogDetailProps = (lang: LanguageEnum) => {
})
: { ...metaData, tree: content };

const moreBlogs = allData
.filter(v => v.tags.some(tag => tags.includes(tag) && v.id !== id))
.slice(0, 4);

return {
props: {
locale: lang,
newHtml,
anchorList: anchorList.filter(item => item.label !== rest.title),
codeList,
moreBlogs: allData
.filter(v => v.tags.some(tag => tags.includes(tag) && v.id !== id))
.slice(0, 4),
moreBlogs: moreBlogs.length
? moreBlogs
: allData.filter(item => item.id !== id).slice(0, 4),
tags,
...rest,
},
Expand Down

0 comments on commit 3d5ab11

Please sign in to comment.