site_header start
This commit is contained in:
@ -1 +1,2 @@
|
||||
pub mod site_footer;
|
||||
pub mod site_header;
|
||||
|
29
axum_server/src/components/site_header.rs
Normal file
29
axum_server/src/components/site_header.rs
Normal file
@ -0,0 +1,29 @@
|
||||
pub struct Link {
|
||||
pub href: String,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
pub struct HeaderProps {
|
||||
pub links: Vec<Link>,
|
||||
}
|
||||
|
||||
impl Default for HeaderProps {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
links: vec![
|
||||
Link {
|
||||
href: "/".to_string(),
|
||||
label: "Introduction".to_string(),
|
||||
},
|
||||
Link {
|
||||
href: "/blog".to_string(),
|
||||
label: "Blog".to_string(),
|
||||
},
|
||||
Link {
|
||||
href: "/portfolio".to_string(),
|
||||
label: "Portfolio".to_string(),
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user