mygit

[UNMAINTAINED] A cgit/webgit alternative, written in Rust
Log | Files | Refs | README | LICENSE

commit 04082ef80ab084046f6faf228dfdcc365b49333a
parent 9ca38bbe2ab89b233896e0fb958d371716c93a91
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Mon, 22 Mar 2021 18:47:34 -0700

Add site name to index.html

Diffstat:
Msrc/main.rs | 6+++++-
Mtemplates/index.html | 2+-
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -100,6 +100,7 @@ fn args() -> Config { #[template(path = "index.html")] // using the template in this path, relative struct IndexTemplate { repos: Vec<Repository>, + site_name: String, } async fn index(_req: Request<()>) -> tide::Result { @@ -117,7 +118,10 @@ async fn index(_req: Request<()>) -> tide::Result { }) .map_err(|e| tide::log::warn!("can not read repositories: {}", e)) .unwrap_or_default(); - let index_template = IndexTemplate { repos }; + let index_template = IndexTemplate { + repos, + site_name: CONFIG.site_name.to_owned(), + }; Ok(index_template.into()) } diff --git a/templates/index.html b/templates/index.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %} - <div class="page-title"><h1>Repositories</h1></div> +<div class="page-title"><h1>{{site_name}}</h1></div> <div> <table> {% for repo in repos %}