kolibri_blog/src/pages/posts/[post_id].astro
guamss 6319371ee4
All checks were successful
Déploiement Docker Vite / deploy (push) Successful in 7m41s
fix: accesibility fix
2026-09-14 18:25:48 +02:00

34 lines
813 B
Plaintext

---
import { getCollection, type CollectionEntry, render } from "astro:content";
import Layout from "../../layouts/Layout.astro";
import "../../styles/post.css";
export async function getStaticPaths() {
const posts = await getCollection("blog");
return posts.map((post: { id: any }) => ({
params: { post_id: post.id },
props: post,
}));
}
type Props = CollectionEntry<"blog">;
const post = Astro.props;
const { Content } = await render(post);
---
<Layout>
<div class="post-div">
<article class="post-container">
<hgroup class="post-header">
<h1>{post.data.title}</h1>
<h2>{post.data.tags}</h2>
<img src={post.data.illustration?.src} alt="" />
</hgroup>
<div class="post-content">
<Content />
</div>
</article>
</div>
</Layout>