From 127e297e753d8132494f6ed5524224ddb2e34821 Mon Sep 17 00:00:00 2001 From: grassblock Date: Tue, 19 Aug 2025 21:17:02 +0800 Subject: [PATCH] fix: article cover not displaying and potential errors --- src/pages/blog/[...slug].astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index 3187d5c..a4c5164 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -46,7 +46,7 @@ const authorInfo = authorData.includes(undefined) ? [{data: siteConfig.defaultA // get featured image and use it as og:image // use the custom cover image if it exists, otherwise use the featured image file in the same directory const featuredImages = import.meta.glob(`/src/content/posts/*/featured.{avif,png,jpg,jpeg,webp}`,{import:'default',eager:true}); -const customFeaturedImage = entry.data.cover?.src +const customFeaturedImage = entry.data.cover const matchedImage = Object.keys(featuredImages).find(path => path.includes(slug)); let matchedImage_src; if (matchedImage && !customFeaturedImage) {