From 6118efc61e326bd1299ac2532bdf2c6a349cf740 Mon Sep 17 00:00:00 2001 From: LazuliKao Date: Mon, 23 Sep 2024 11:14:32 +0800 Subject: [PATCH] fix MoreTile --- astro.config.mts | 10 +++++----- src/layouts/MoreTile.astro | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/astro.config.mts b/astro.config.mts index c69a163..e4a0909 100644 --- a/astro.config.mts +++ b/astro.config.mts @@ -185,11 +185,11 @@ const handleLocalCoverPlugin: RehypePlugin = () => { type AstroData = { frontmatter: { cover: - | { - url: string - } - | string - | undefined + | { + url: string + } + | string + | undefined } } const astroData = file.data.astro as AstroData diff --git a/src/layouts/MoreTile.astro b/src/layouts/MoreTile.astro index d2149bd..a09fe01 100644 --- a/src/layouts/MoreTile.astro +++ b/src/layouts/MoreTile.astro @@ -4,7 +4,7 @@ const { title, href, cover, tags, date } = Astro.props const dateFormatted = formatDate(date) const type = tags?.[0] ?? "默认" -const image = cover?.url ? cover : "https://oss.nbtca.space/CA-logo.svg" +const image = cover?.url ?? cover ?? "https://oss.nbtca.space/CA-logo.svg" const label = `${title} - ${type} - 发表时间 ${dateFormatted}`; ---