Add icon to reading_time and datetime
This commit is contained in:
parent
76dd9b0783
commit
816ef54e82
9 changed files with 90 additions and 23 deletions
|
@ -3,11 +3,7 @@ use leptos_router::*;
|
|||
use crate::app::{
|
||||
models::Post,
|
||||
components::{
|
||||
Loading, Nav
|
||||
},
|
||||
utils::{
|
||||
datetime::human_datetime,
|
||||
reading_time::human_reading_time
|
||||
Loading, Nav, ReadingTime, DateTime
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -90,8 +86,8 @@ pub fn PostListCard(
|
|||
<PostTags tags=post.metadata.tags.clone()/>
|
||||
<h2><A href=format!("/posts/{}", post.metadata.slug.clone())>{post.metadata.title.clone()}</A></h2>
|
||||
<p>{post.metadata.description.clone()}</p>
|
||||
<span>{human_datetime(&post.metadata.date)}</span>
|
||||
<span>{human_reading_time(post.metadata.reading_time)}</span>
|
||||
<DateTime datetime=post.metadata.date />
|
||||
<ReadingTime time=post.metadata.reading_time />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
@ -150,8 +146,8 @@ pub fn PostElement() -> impl IntoView {
|
|||
<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>{human_datetime(&post.metadata.date)}</span>
|
||||
<span>{human_reading_time(post.metadata.reading_time)}</span>
|
||||
<DateTime datetime=post.metadata.date />
|
||||
<ReadingTime time=post.metadata.reading_time />
|
||||
<PostTags tags=post.metadata.tags.clone()/>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue