Merge pull request #1600 from expoli/expoli_patch

[fix] 文章不存在封面的时候,不使用默认站点封面,导致不显示封面的问题
This commit is contained in:
tangly1024
2023-11-01 13:59:10 +08:00
committed by GitHub
4 changed files with 19 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ import LazyImage from '@/components/LazyImage'
const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
const showPreview = CONFIG.POST_LIST_PREVIEW && post.blockMap
if (post && !post.pageCoverThumbnail && CONFIG.POST_LIST_COVER_DEFAULT) {
post.pageCover = siteInfo?.pageCoverThumbnail
post.pageCoverThumbnail = siteInfo?.pageCover
}
const showPageCover = CONFIG.POST_LIST_COVER && post?.pageCoverThumbnail && !showPreview
// const delay = (index % 2) * 200

View File

@@ -16,6 +16,12 @@ const MenuGroupCard = (props) => {
{ name: locale.COMMON.TAGS, to: '/tag', slot: tagSlot, show: CONFIG.MENU_TAG }
]
for (let i = 0; i < links.length; i++) {
if (links[i].id !== i) {
links[i].id = i
}
}
return (
<nav id='nav' className='leading-8 flex justify-center dark:text-gray-200 w-full'>
{links.map(link => {

View File

@@ -18,6 +18,12 @@ export const MenuListSide = (props) => {
if (customNav) {
links = customNav.concat(links)
}
for (let i = 0; i < links.length; i++) {
if (links[i].id !== i) {
links[i].id = i
}
}
// 如果 开启自定义菜单则覆盖Page生成的菜单
if (BLOG.CUSTOM_MENU) {

View File

@@ -20,6 +20,12 @@ export const MenuListTop = (props) => {
links = links.concat(customNav)
}
for (let i = 0; i < links.length; i++) {
if (links[i].id !== i) {
links[i].id = i
}
}
// 如果 开启自定义菜单则覆盖Page生成的菜单
if (BLOG.CUSTOM_MENU) {
links = customMenu