@valid moon in a Markdown file, I have the following file structure:
---
layout: "@layouts/MarkdownPostLayout.astro"
title: TIDAL "Wrapped" 2023
author: Steve Frenzel
description: My favorite tunes from the year Tina Turner died, Twitter turned X and mass shootings in the U.S. reached a new all-time high.
pubDate: 2024-01-07
slug: tidal-wrapped-2023
tags: ["music", "tidal"]
image:
url: ../../images/blog/5/thumbnail-tidal-wrapped-2023.png
alt: "Tidal Wrapped 2023"
---
When referencing the image url via frontmatter.image.url the image is not correctly displayed, while the alt text of it is correct. I also want to use the same image for the OpenGraph image for social previews but again, it's not working.
Here's the code for the blog post layout:
---
import type { FrontmatterProps } from "../types/FrontmatterProps";
import Layout from "@layouts/Layout.astro";
import SkipLink from "@utils/SkipLink.astro";
interface Props {
frontmatter: FrontmatterProps;
}
const { frontmatter } = Astro.props;
const dateFormatted = new Date(frontmatter.pubDate).toLocaleDateString(
undefined,
{ year: "numeric", month: "long", day: "numeric" },
);
---
<Layout
description={frontmatter.description}
thumbnail={frontmatter.image.url}
title={frontmatter.title}
>
<div id="markdown-wrapper">
<header>
<SkipLink />
<h1>{frontmatter.title}</h1>
<div>
<p class="author-and-date">
{frontmatter.author} - {dateFormatted}
</p>
<a href="/blog">Back to blog</a>
</div>
<img src={frontmatter.image.url} alt={frontmatter.image.alt} />
</header>
</div>
</Layout>
When moving the image for OpenGraph to the public folder, what changes would I need to make in my blog post layout in order to make it work?