Update post page

This commit is contained in:
Florian RICHER 2024-01-07 23:18:13 +01:00
parent 9cd4298764
commit 4ab4b95d8a

View file

@ -128,11 +128,10 @@ pub fn PostElement() -> impl IntoView {
post.and_then(|post| {
view! {
<>
<PostTags tags=post.metadata.tags.clone()/>
{
if post.metadata.draft {
Some(view!{
<div class="bg-warning text-on_warning dark:bg-dark_warning dark:text-dart_on_warning rounded-md p-5">
<div class="bg-warning text-on_warning dark:bg-dark_warning dark:text-dart_on_warning rounded-md p-5 mb-5">
r#"
L'article est en cours d'écriture. La formulation peut ne pas être exacte et les phrases peuvent contenir des fautes.
"#
@ -142,6 +141,15 @@ pub fn PostElement() -> impl IntoView {
None
}
}
<div class="border-b-2 pb-5">
<img src={post.metadata.image_path.clone()} alt=format!("Image {}", post.metadata.title)/>
<h1>{post.metadata.title.clone()}</h1>
<p>{post.metadata.description.clone()}</p>
<span>{post.metadata.date.clone()}</span>
<PostTags tags=post.metadata.tags.clone()/>
</div>
<div inner_html={post.content.clone()}></div>
</>
}