plcom: moved footer to its own function

This commit is contained in:
Philippe Loctaux 2025-07-05 01:24:00 +02:00
parent fd947858e9
commit e51d14b47c

View file

@ -8,7 +8,6 @@ pub fn shell(title: &str, children: impl IntoAny) -> AnyView {
title.into() title.into()
}; };
let year = jiff::Zoned::now().year();
view! { view! {
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -36,15 +35,12 @@ pub fn shell(title: &str, children: impl IntoAny) -> AnyView {
<main class=tw_join!("flex-grow")> <main class=tw_join!("flex-grow")>
{children.into_any()} {children.into_any()}
</main> </main>
<footer class=tw_join!("bg-black")> {footer().into_any()}
<div class=tw_join!("container", "mx-auto", "px-4", "py-8")>
<p>"© 2015 - "{year}" Philippe Loctaux, made with "{underline_link(Link::new(uri!("https://leptos.dev").into(), "Leptos"), None).into_any()}"."</p>
</div>
</footer>
</body> </body>
{stats().into_any()} {stats().into_any()}
</html> </html>
}.into_any() }
.into_any()
} }
pub fn content_page(title: &str, children: impl IntoAny) -> AnyView { pub fn content_page(title: &str, children: impl IntoAny) -> AnyView {
@ -62,7 +58,18 @@ pub fn content_page(title: &str, children: impl IntoAny) -> AnyView {
.into_any() .into_any()
} }
pub fn stats() -> impl IntoView { fn footer() -> impl IntoView {
let year = jiff::Zoned::now().year();
view! {
<footer class=tw_join!("bg-black")>
<div class=tw_join!("container", "mx-auto", "px-4", "py-8")>
<p>"© 2015 - "{year}" Philippe Loctaux, made with "{underline_link(Link::new(uri!("https://leptos.dev").into(), "Leptos"), None).into_any()}"."</p>
</div>
</footer>
}
}
fn stats() -> impl IntoView {
view! { view! {
<script inner_html=r#" <script inner_html=r#"
window.goatcounter = { window.goatcounter = {