tablejohn/src/web/commit.rs
2023-08-06 18:33:50 +02:00

20 lines
491 B
Rust

use askama::Template;
use axum::{extract::State, response::IntoResponse};
use crate::{config::Config, somehow};
#[derive(Template)]
#[template(path = "commit.html")]
struct CommitTemplate {
base: String,
repo_name: String,
current: &'static str,
}
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",
})
}