Group base template parameters

This commit is contained in:
Joscha 2023-08-06 18:29:31 +02:00
parent 729b3ba672
commit 90a446a576
7 changed files with 46 additions and 33 deletions

View file

@ -3,18 +3,16 @@ use axum::{extract::State, response::IntoResponse};
use crate::{config::Config, somehow};
use super::{Base, Tab};
#[derive(Template)]
#[template(path = "commit.html")]
struct CommitTemplate {
base: String,
repo_name: String,
current: &'static str,
base: Base,
}
pub async fn get(State(config): State<&'static Config>) -> somehow::Result<impl IntoResponse> {
Ok(CommitTemplate {
base: config.web.base(),
repo_name: config.repo.name(),
current: "commit",
base: Base::new(config, Tab::Commit),
})
}