diff --git a/astro.config.mts b/astro.config.mts index dba5f0e..8b842f5 100644 --- a/astro.config.mts +++ b/astro.config.mts @@ -182,7 +182,7 @@ export default defineConfig({ markdown: { rehypePlugins: pipeline(), syntaxHighlight: "prism", - }, + }, integrations: [ vue(), tailwind(), diff --git a/src/layouts/MoreTile.astro b/src/layouts/MoreTile.astro index 7d2aad2..6a95970 100644 --- a/src/layouts/MoreTile.astro +++ b/src/layouts/MoreTile.astro @@ -5,32 +5,36 @@ const { title, href, cover, tags, date } = Astro.props const dateFormatted = formatDate(date) const type = tags?.[0] ?? "默认" -const image = cover ? cover : "https://oss.nbtca.space/CA-logo.svg" +let image: string + = cover?.url ?? cover ?? "https://oss.nbtca.space/CA-logo.svg" +if (image.startsWith("./")) { + image = `./${href}${image.slice(1)}` +} -const label = `${title} - ${type} - 发表时间 ${dateFormatted}` +const label = `${title} - ${type} - 发表时间 ${dateFormatted}`; --- -