首页首区改为个人简介(HomeInfo)
- 删除 FirstEntry(首篇文章精选)组件 - 新增 HomeInfo 组件:居中标题 "Yggdrasil" + 简介 - 文章列表从第 1 篇开始显示(共 6 篇) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1d57c91836
commit
f52b3165da
@ -62,8 +62,8 @@ pub fn HomePage() -> Element {
|
|||||||
div { class: "min-h-screen flex flex-col bg-white dark:bg-[#1d1e20] transition-colors duration-300",
|
div { class: "min-h-screen flex flex-col bg-white dark:bg-[#1d1e20] transition-colors duration-300",
|
||||||
Header {}
|
Header {}
|
||||||
main { class: "flex-1 w-full max-w-3xl mx-auto px-6 py-6",
|
main { class: "flex-1 w-full max-w-3xl mx-auto px-6 py-6",
|
||||||
FirstEntry { post: POSTS[0].clone() }
|
HomeInfo {}
|
||||||
for post in POSTS.iter().skip(1) {
|
for post in POSTS.iter() {
|
||||||
PostEntry { post: post.clone() }
|
PostEntry { post: post.clone() }
|
||||||
}
|
}
|
||||||
Pagination {}
|
Pagination {}
|
||||||
@ -115,28 +115,14 @@ fn NavItem(href: &'static str, label: &'static str, #[props(default = false)] ac
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
fn FirstEntry(post: Post) -> Element {
|
fn HomeInfo() -> Element {
|
||||||
let tag_items = post.tags.iter().map(|t| *t).collect::<Vec<_>>();
|
|
||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
article { class: "mb-10",
|
div { class: "mb-10 text-center",
|
||||||
a { class: "block group", href: "/post/{post.slug}",
|
h1 { class: "text-[34px] font-bold leading-tight text-gray-900 dark:text-[#dadadb]",
|
||||||
h1 { class: "text-[34px] font-bold leading-tight text-gray-900 dark:text-[#dadadb] group-hover:opacity-80 transition-opacity",
|
"Yggdrasil"
|
||||||
"{post.title}"
|
}
|
||||||
}
|
p { class: "mt-3 text-base text-gray-500 dark:text-[#9b9c9d] leading-relaxed",
|
||||||
div { class: "mt-3 text-base text-gray-500 dark:text-[#9b9c9d] leading-relaxed",
|
"以文字为主的简约博客系统"
|
||||||
"{post.summary}"
|
|
||||||
}
|
|
||||||
div { class: "mt-4 flex items-center gap-3 text-sm text-gray-400 dark:text-[#9b9c9d]",
|
|
||||||
span { "{post.date}" }
|
|
||||||
span { "·" }
|
|
||||||
for (i, tag) in tag_items.iter().enumerate() {
|
|
||||||
if i > 0 {
|
|
||||||
span { "," }
|
|
||||||
}
|
|
||||||
span { "{tag}" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user