Add empty /commit/ page
This commit is contained in:
parent
eb29f1166a
commit
965efa5b58
4 changed files with 32 additions and 0 deletions
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
20
src/web/commit.rs
Normal file
20
src/web/commit.rs
Normal file
|
|
@ -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<impl IntoResponse> {
|
||||
Ok(CommitTemplate {
|
||||
base: config.web.base(),
|
||||
repo_name: config.repo.name(),
|
||||
current: "commit".to_string(),
|
||||
})
|
||||
}
|
||||
|
|
@ -15,6 +15,9 @@
|
|||
<img src="{{ base }}/logo.svg">
|
||||
{{ repo_name }}
|
||||
</a>
|
||||
<a href="{{ base }}/commit/" {% if current=="commit" %} class="current" {% endif %}>
|
||||
commit
|
||||
</a>
|
||||
<a>just</a>
|
||||
<a>some</a>
|
||||
<a>place</a>
|
||||
|
|
|
|||
7
templates/commit.html
Normal file
7
templates/commit.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}commit{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
Sorry, nothing here yet.
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue