Here's the file structure in the image.
Do i need to use Layout in Stickie? So i have the Stickie:
---
const {post} = Astro.props;
const {Content} = await post.render();
console.log(Content);
---
<div>
<h1>{post.data.title}</h1>
<Content/>
</div>
Then i have the Layout:
---
export interface Props {
title: string;
}
const {title} = Astro.props;
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body>
<slot />
</body>
</html>
And i combine both in the index.astro:
---
import Layout from "../layouts/Layout.astro";
import Stickie from "../components/Stickie.astro";
import {getCollection} from "astro:content";
const allStickies = await getCollection("stickies");
---
---
import Layout from "../layouts/Layout.astro";
import Stickie from "../components/Stickie.astro";
import {getCollection} from "astro:content";
const allStickies = await getCollection("stickies");
---
<Layout title="Portfolio">
<main id="whiteboard">
<section id="home">
<h1>Portfolio</h1>
<div>
{ allStickies.map((post) => {
return (
<Stickie post={post} />
)
})}
</div>
</section>
<section id="about">
<h2>About</h2>
</section>
<section id="why">
<h2>Why</h2>
</section>
<section id="see">
<h2>See</h2>
</section>
</main>
</Layout>
I did bundled everything in index.astro and the error returns the same