diff --git a/src/web.rs b/src/web.rs index e6b71f4..df97d77 100644 --- a/src/web.rs +++ b/src/web.rs @@ -1,3 +1,4 @@ +mod commit; mod index; mod r#static; @@ -10,6 +11,7 @@ pub async fn run(state: AppState) -> somehow::Result<()> { let app = Router::new() .route("/", get(index::get)) + .route("/commit/", get(commit::get)) .fallback(get(r#static::static_handler)) .with_state(state.clone()); diff --git a/src/web/commit.rs b/src/web/commit.rs new file mode 100644 index 0000000..e4972ee --- /dev/null +++ b/src/web/commit.rs @@ -0,0 +1,20 @@ +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: String, +} + +pub async fn get(State(config): State<&'static Config>) -> somehow::Result { + Ok(CommitTemplate { + base: config.web.base(), + repo_name: config.repo.name(), + current: "commit".to_string(), + }) +} diff --git a/templates/base.html b/templates/base.html index 3255926..a1c816b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -15,6 +15,9 @@ {{ repo_name }} + + commit + just some place diff --git a/templates/commit.html b/templates/commit.html new file mode 100644 index 0000000..dd73ed0 --- /dev/null +++ b/templates/commit.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} + +{% block title %}commit{% endblock %} + +{% block body %} +Sorry, nothing here yet. +{% endblock %}