Switch over to WebAssembly, Rust and Yew #35

Merged
BlakeRain merged 87 commits from yew-static into main 2023-08-30 18:01:40 +00:00
Showing only changes of commit 9c3cb1e9e6 - Show all commits

View File

@ -28,8 +28,7 @@ fn post_card_image(doc_id: DocId, title: &str, image: &Option<String>) -> Html {
} }
pub fn post_card_details<S>(horizontal: bool, info: &Details<S>, tags: &TagsContext) -> Html { pub fn post_card_details<S>(horizontal: bool, info: &Details<S>, tags: &TagsContext) -> Html {
let mut facts = let mut facts = Intersperse::new(html! { <span class="text-gray-500">{""}</span> });
Intersperse::new(html! { <Icon class="text-gray-500" icon_id={IconId::BootstrapDot} /> });
if let Some(published) = info.summary.published { if let Some(published) = info.summary.published {
facts.push(html! { <div>{published.format(DATE_FORMAT).expect("valid format")}</div> }); facts.push(html! { <div>{published.format(DATE_FORMAT).expect("valid format")}</div> });
@ -40,11 +39,11 @@ pub fn post_card_details<S>(horizontal: bool, info: &Details<S>, tags: &TagsCont
} }
let tags = Intersperse::from_iter( let tags = Intersperse::from_iter(
html! { <Icon class="text-gray-500" icon_id={IconId::BootstrapDot} /> }, html! { <span class="text-gray-500">{""}</span> },
info.tags.iter().map(|tag| { info.tags.iter().map(|tag| {
if let Some(tag) = tags.get(tag) { if let Some(tag) = tags.get(tag) {
html! { html! {
<span class="text-sky-500">{tag.name.clone()}</span> <span class="text-sky-700 dark:text-sky-500">{tag.name.clone()}</span>
} }
} else { } else {
html! { html! {
@ -61,10 +60,10 @@ pub fn post_card_details<S>(horizontal: bool, info: &Details<S>, tags: &TagsCont
} else { } else {
"flex-col" "flex-col"
})}> })}>
<div class="flex flex-row"> <div class="flex flex-row gap-1">
{facts.finish()} {facts.finish()}
</div> </div>
<div class="flex flex-row"> <div class="flex flex-row gap-1">
{tags.finish()} {tags.finish()}
</div> </div>
</div> </div>