fix: post cover

This commit is contained in:
HPCesia 2025-03-24 22:10:13 +08:00
parent 34804d525d
commit 7e40bf2eda

View File

@ -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;