Новые изменения в коде проекта
This commit is contained in:
parent
0777fc201f
commit
aef12e853d
12 changed files with 159 additions and 15 deletions
|
|
@ -6,7 +6,7 @@ export interface Props {
|
|||
categoryColor?: string;
|
||||
date: string;
|
||||
readTime: string;
|
||||
imageUrl?: string;
|
||||
image?: string;
|
||||
slug?: string;
|
||||
}
|
||||
|
||||
|
|
@ -17,9 +17,11 @@ const {
|
|||
categoryColor = 'bg-gold',
|
||||
date,
|
||||
readTime,
|
||||
imageUrl = '/images/blog/default.avif',
|
||||
image,
|
||||
slug = '#'
|
||||
} = Astro.props;
|
||||
|
||||
const imageUrl = image || '/images/blog/default.avif';
|
||||
---
|
||||
|
||||
<article class="blog-card" data-animation="fade-up">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
import BlogCard from '@components/blog/BlogCard.astro';
|
||||
import { getPostImageUrl } from '@lib/pb';
|
||||
|
||||
interface Post {
|
||||
id: string;
|
||||
|
|
@ -10,7 +11,7 @@ interface Post {
|
|||
categoryColor: string;
|
||||
date: string;
|
||||
readTime: string;
|
||||
imageUrl: string;
|
||||
image: string;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
|
|
@ -47,7 +48,7 @@ const filteredPosts = currentSlug
|
|||
categoryColor={post.categoryColor}
|
||||
date={formatDate(post.date)}
|
||||
readTime={post.readTime}
|
||||
imageUrl={post.imageUrl}
|
||||
image={getPostImageUrl(post)}
|
||||
slug={`/blog/${post.slug}`}
|
||||
/>
|
||||
))}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue