diff --git a/src/components/Cards/PostCard.jsx b/src/components/Cards/PostCard.jsx index bc499a8..145b29f 100644 --- a/src/components/Cards/PostCard.jsx +++ b/src/components/Cards/PostCard.jsx @@ -3,10 +3,12 @@ import React from 'react'; import { Button } from '@progress/kendo-react-buttons'; import { Card, CardImage, CardBody } from '@progress/kendo-react-layout'; +// Import all header images so Vite processes them +const headerImages = import.meta.glob('../../assets/header/*', { eager: true }); + const PostCard = ({ post, onEdit }) => { const dataPath = post.header.image; - const relativePath = `../../${dataPath}`; - const imageUrl = new URL(relativePath, import.meta.url).href; + const imageUrl = headerImages[`../../${dataPath}`]?.default || dataPath; const formatDate = (utcString) => { if (!utcString) return '';