All checks were successful
Déploiement Docker Vite / deploy (push) Successful in 7m41s
34 lines
813 B
Plaintext
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>
|