Commit 7e40bf2

HPCesia <me@hpcesia.com>
2025-03-24 14:10:13
fix: post cover
1 parent 34804d5
Changed files (1)
src
pages
src/pages/posts/[article].astro
@@ -24,7 +24,8 @@ export async function getStaticPaths() {
 
 const { article } = Astro.props;
 const { Content, headings, remarkPluginFrontmatter } = await render(article);
-const coverSrc = article.data.cover?.src;
+const coverSrc =
+  typeof article.data.cover === 'string' ? article.data.cover : article.data.cover?.src;
 const description = article.data.description || remarkPluginFrontmatter.excerpt;
 const isDraft = article.data.draft === true;