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..638a5ec 100644 --- a/src/layouts/MoreTile.astro +++ b/src/layouts/MoreTile.astro @@ -1,36 +1,39 @@ --- import { formatDate } from "../utils" const { title, href, cover, tags, date } = Astro.props - +import { fixImage } from "../utils/image" const dateFormatted = formatDate(date) const type = tags?.[0] ?? "默认" -const image = cover ? cover : "https://oss.nbtca.space/CA-logo.svg" +let image = cover?.url ?? cover ?? "https://oss.nbtca.space/CA-logo.svg" +if (image.startsWith("./")) { + image = await fixImage(image, href) +} -const label = `${title} - ${type} - 发表时间 ${dateFormatted}` +const label = `${title} - ${type} - 发表时间 ${dateFormatted}`; --- -