I got it to wokr in a hacky way:
<Layout>
<Header activeNav="" />
<main id="main-content">
<section id="hero">
<h1>Projects</h1>
</section>
<Hr />
<section id="projects">
<ul>
{
async () => {
const projects = await Astro.glob("../content/projects/*.md");
const project_props = projects.map(project => ({
params: {
title: project.frontmatter.title,
type: project.frontmatter.type,
link: project.frontmatter.link,
icon: project.frontmatter.icon,
img: project.frontmatter.img,
featured: project.frontmatter.featured,
},
props: {
project,
},
}));
return project_props.map(({ params, props: { project } }) => {
const { Content } = project;
return (
<>
<h2>{params.title}</h2>
<Content />
</>
);
});
}
}
</ul>
</section>
</main>
</Layout>
And for spacing:
#projects {
@apply pb-6;
}
#projects h2 {
@apply mb-2 mt-4 text-2xl font-bold tracking-wide;
}
#projects :global(p) {
@apply mb-4 leading-relaxed;
}
I really don't like the way on how this turned out to be, but it works I guess?? Dunno. I would appreciate feedback