Port test page to Page

This commit is contained in:
Joscha 2024-05-13 14:59:17 +02:00
parent d7c6a5beee
commit a931f00df3

View file

@ -4,7 +4,7 @@ use maud::html;
use crate::{ use crate::{
config::ServerConfig, config::ServerConfig,
server::web::{ server::web::{
base::{Base, Tab}, page::{Page, Tab},
paths::PathTest, paths::PathTest,
}, },
somehow, somehow,
@ -14,14 +14,14 @@ pub async fn get_test(
_path: PathTest, _path: PathTest,
State(config): State<&'static ServerConfig>, State(config): State<&'static ServerConfig>,
) -> somehow::Result<impl IntoResponse> { ) -> somehow::Result<impl IntoResponse> {
let base = Base::new(config, Tab::Index); let html = Page::new(config)
.title("test")
Ok(base.html( .tab(Tab::Index)
"test", .body(html! {
html! {},
html! {
h2 { "Test" } h2 { "Test" }
p { "Hello world!" } p { "Hello world!" }
}, })
)) .build();
Ok(html)
} }