[bootsier] Nuevos componentes Navbar y Offcanvas

This commit is contained in:
Manuel Cillero 2025-01-05 09:23:56 +01:00
parent 0ba93b76ba
commit d35f2c7756
17 changed files with 743 additions and 16 deletions

View file

@ -4,7 +4,7 @@ description = "An opinionated web framework to build modular Server-Side Renderi
theme = "Bootsier"
[bootsier]
max_width = "1600px"
max_width = "1520px"
[log]
rolling = "Daily"

View file

@ -1,5 +1,7 @@
use pagetop::prelude::*;
use pagetop_bootsier::bs::*;
include_files!(BUNDLE_DOC => doc);
include_locales!(LOCALES_WEBSITE);
@ -25,6 +27,34 @@ impl PackageTrait for PageTopWebSite {
}
fn init(&self) {
let nav = Navbar::new().with_nav(TypedOp::Add(TypedComponent::with(
navbar::Nav::new()
.with_item(navbar::Item::link(
L10n::t("menu_home", &LOCALES_WEBSITE),
|cx| match cx.langid().language.as_str() {
"es" => "/es",
_ => "/",
},
))
.with_item(navbar::Item::link(
L10n::t("menu_documentation", &LOCALES_WEBSITE),
|cx| match cx.langid().language.as_str() {
"es" => "/doc/latest/es",
_ => "/doc/latest/en",
},
))
.with_item(navbar::Item::link_blank(
L10n::t("menu_api", &LOCALES_WEBSITE),
|_| "https://docs.rs/pagetop",
))
.with_item(navbar::Item::link_blank(
L10n::t("menu_code", &LOCALES_WEBSITE),
|_| "https://github.com/manuelcillero/pagetop",
)),
)));
InRegion::Content.add(ChildComponent::with(nav));
/*
let branding = Branding::new()
.with_logo(Some(Image::pagetop()))