--- import BaseHead from "../components/BaseHead.astro"; import Header from "../components/Header.astro"; import Footer from "../components/Footer.astro"; import {Image} from '@astrojs/image/components'; export interface Props { content: { title: string; description: string; publishDate?: string; updatedDate?: string; heroImage?: string; }; } const { content: { title, description, publishDate, updatedDate, heroImage }, } = Astro.props as Props; // Match the `heroImage` frontmatter string to its correct // Astro.glob() import of the file in the src/ directory. const assets = await Astro.glob('../assets/**/*'); const heroImageAsset = assets.find(asset => { if (!heroImage) { return false; } if (!asset.default?.src) { return false; } const index = asset.default.src.indexOf('/assets/'); return asset.default.src.slice(index) === heroImage; }); ---