mini-player: finished implementation, now need to keep trakc of state

This commit is contained in:
Agahnim 2026-03-20 14:18:12 +01:00
parent ca25a97263
commit 4b4044d689
9 changed files with 320 additions and 48 deletions

View file

@ -5,17 +5,17 @@ use axum::{
};
#[derive(Template)]
#[template(path = "index.html")]
struct IndexTemplate;
#[template(path = "home.html")]
struct HomeTemplate;
#[derive(Template)]
#[template(path = "partials/index.html")]
struct IndexPartialTemplate;
#[template(path = "partials/home.html")]
struct HomePartialTemplate;
pub async fn home(headers: HeaderMap) -> impl IntoResponse {
if headers.contains_key("hx-request") {
Html(IndexPartialTemplate.render().unwrap())
Html(HomePartialTemplate.render().unwrap())
} else {
Html(IndexTemplate.render().unwrap())
Html(HomeTemplate.render().unwrap())
}
}

View file

@ -1,4 +1,4 @@
pub mod index;
pub mod home;
pub mod miniplayer;
pub mod music;
pub mod notfound;