🚧 [website] Sitio en español por defecto
This commit is contained in:
parent
3a5dadc054
commit
13932dc930
2 changed files with 49 additions and 69 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
name = "PageTop"
|
name = "PageTop"
|
||||||
description = "An opinionated web framework to build modular Server-Side Rendering web solutions."
|
description = "An opinionated web framework to build modular Server-Side Rendering web solutions."
|
||||||
theme = "Bootsier"
|
theme = "Bootsier"
|
||||||
|
language = "es"
|
||||||
|
|
||||||
[bootsier]
|
[bootsier]
|
||||||
max_width = "1520px"
|
max_width = "1520px"
|
||||||
|
|
|
||||||
|
|
@ -27,20 +27,20 @@ impl PackageTrait for PageTopWebSite {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn init(&self) {
|
fn init(&self) {
|
||||||
let nav = Navbar::new().with_nav(TypedOp::Add(Typed::with(
|
let nav = Navbar::with_nav(
|
||||||
navbar::Nav::new()
|
navbar::Nav::new()
|
||||||
.with_item(navbar::Item::link(
|
.with_item(navbar::Item::link(
|
||||||
L10n::t("menu_home", &LOCALES_WEBSITE),
|
L10n::t("menu_home", &LOCALES_WEBSITE),
|
||||||
|cx| match cx.langid().language.as_str() {
|
|cx| match cx.langid().language.as_str() {
|
||||||
"es" => "/es",
|
"en" => "/en",
|
||||||
_ => "/",
|
_ => "/",
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
.with_item(navbar::Item::link(
|
.with_item(navbar::Item::link(
|
||||||
L10n::t("menu_documentation", &LOCALES_WEBSITE),
|
L10n::t("menu_documentation", &LOCALES_WEBSITE),
|
||||||
|cx| match cx.langid().language.as_str() {
|
|cx| match cx.langid().language.as_str() {
|
||||||
"es" => "/doc/latest/es",
|
"en" => "/doc/latest/en",
|
||||||
_ => "/doc/latest/en",
|
_ => "/doc/latest/es",
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
.with_item(navbar::Item::link_blank(
|
.with_item(navbar::Item::link_blank(
|
||||||
|
|
@ -50,43 +50,8 @@ impl PackageTrait for PageTopWebSite {
|
||||||
.with_item(navbar::Item::link_blank(
|
.with_item(navbar::Item::link_blank(
|
||||||
L10n::t("menu_code", &LOCALES_WEBSITE),
|
L10n::t("menu_code", &LOCALES_WEBSITE),
|
||||||
|_| "https://github.com/manuelcillero/pagetop",
|
|_| "https://github.com/manuelcillero/pagetop",
|
||||||
)),
|
)), /*
|
||||||
)));
|
.with_item(navbar::Item::html(Html::with(html! {
|
||||||
|
|
||||||
InRegion::Content.add(Child::with(nav));
|
|
||||||
|
|
||||||
/*
|
|
||||||
let branding = Branding::new()
|
|
||||||
.with_logo(Some(Image::pagetop()))
|
|
||||||
.with_slogan(L10n::t("app_slogan", &LOCALES_WEBSITE))
|
|
||||||
.with_frontpage(|cx| match cx.langid().language.as_str() {
|
|
||||||
"es" => "/es",
|
|
||||||
_ => "/",
|
|
||||||
});
|
|
||||||
let menu = Menu::new()
|
|
||||||
.add_item(menu::Item::link(
|
|
||||||
L10n::t("menu_home", &LOCALES_WEBSITE),
|
|
||||||
|cx| match cx.langid().language.as_str() {
|
|
||||||
"es" => "/es",
|
|
||||||
_ => "/",
|
|
||||||
},
|
|
||||||
))
|
|
||||||
.add_item(menu::Item::link(
|
|
||||||
L10n::t("menu_documentation", &LOCALES_WEBSITE),
|
|
||||||
|cx| match cx.langid().language.as_str() {
|
|
||||||
"es" => "/doc/latest/es",
|
|
||||||
_ => "/doc/latest/en",
|
|
||||||
},
|
|
||||||
))
|
|
||||||
.add_item(menu::Item::link_blank(
|
|
||||||
L10n::t("menu_api", &LOCALES_WEBSITE),
|
|
||||||
|_| "https://docs.rs/pagetop",
|
|
||||||
))
|
|
||||||
.add_item(menu::Item::link_blank(
|
|
||||||
L10n::t("menu_code", &LOCALES_WEBSITE),
|
|
||||||
|_| "https://github.com/manuelcillero/pagetop",
|
|
||||||
))
|
|
||||||
.add_item(menu::Item::html(Html::with(html! {
|
|
||||||
select id="select-lang" {
|
select id="select-lang" {
|
||||||
option value="en" { "EN" }
|
option value="en" { "EN" }
|
||||||
option value="es" { "ES" }
|
option value="es" { "ES" }
|
||||||
|
|
@ -98,7 +63,21 @@ impl PackageTrait for PageTopWebSite {
|
||||||
selectLang.addEventListener('change',function(){window.location.href='/'+selectLang.value;});
|
selectLang.addEventListener('change',function(){window.location.href='/'+selectLang.value;});
|
||||||
"###
|
"###
|
||||||
}
|
}
|
||||||
})));
|
})) */
|
||||||
|
)
|
||||||
|
.with_id("main-menu")
|
||||||
|
.with_expand(BreakPoint::LG);
|
||||||
|
|
||||||
|
InRegion::Content.add(Child::with(nav));
|
||||||
|
|
||||||
|
/*
|
||||||
|
let branding = Branding::new()
|
||||||
|
.with_logo(Some(Image::pagetop()))
|
||||||
|
.with_slogan(L10n::t("app_slogan", &LOCALES_WEBSITE))
|
||||||
|
.with_frontpage(|cx| match cx.langid().language.as_str() {
|
||||||
|
"es" => "/es",
|
||||||
|
_ => "/",
|
||||||
|
});
|
||||||
|
|
||||||
InRegion::Named("header").add(AnyComponent::with(
|
InRegion::Named("header").add(AnyComponent::with(
|
||||||
flex::Container::new()
|
flex::Container::new()
|
||||||
|
|
@ -128,8 +107,8 @@ impl PackageTrait for PageTopWebSite {
|
||||||
|
|
||||||
async fn doc_latest(path: service::web::Path<String>) -> service::HttpResponse {
|
async fn doc_latest(path: service::web::Path<String>) -> service::HttpResponse {
|
||||||
match path.into_inner().as_str() {
|
match path.into_inner().as_str() {
|
||||||
"es" => Redirect::see_other("/doc/v0.0/es/index.html"),
|
"en" => Redirect::see_other("/doc/v0.0/en/index.html"),
|
||||||
_ => Redirect::see_other("/doc/v0.0/en/index.html"),
|
_ => Redirect::see_other("/doc/v0.0/es/index.html"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue