From 000c5dca60170c4efee0ecf91cac956211c48ead Mon Sep 17 00:00:00 2001 From: holly sparkles Date: Fri, 8 Dec 2023 18:05:23 +0100 Subject: [PATCH] feat: add displaying custom root title --- src/methods/index.rs | 8 +++++++- templates/base.html | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/methods/index.rs b/src/methods/index.rs index ed10048..2964a40 100644 --- a/src/methods/index.rs +++ b/src/methods/index.rs @@ -6,6 +6,7 @@ use axum::{response::IntoResponse, Extension}; use super::filters; use crate::{ + configuration::AppConfig, database::schema::repository::{Repository, YokedRepository}, into_response, }; @@ -14,10 +15,12 @@ use crate::{ #[template(path = "index.html")] pub struct View { pub repositories: BTreeMap, Vec>, + pub config: AppConfig, } pub async fn handle( Extension(db): Extension>, + Extension(config): Extension, ) -> Result { let mut repositories: BTreeMap, Vec> = BTreeMap::new(); @@ -34,5 +37,8 @@ pub async fn handle( k.push(v); } - Ok(into_response(View { repositories })) + Ok(into_response(View { + repositories, + config, + })) } diff --git a/templates/base.html b/templates/base.html index 74340ed..d573141 100644 --- a/templates/base.html +++ b/templates/base.html @@ -12,7 +12,7 @@

🏡 - {% block header -%}Git repository browser{%- endblock %} + {% block header -%}{{ config.root_title }}{%- endblock %}

-- libgit2 1.7.2