mygit

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

commit 4f85dbf0331f046fd945ba8f1c83a429057e1b78
parent d6b9cb2efb5146efd512fb51f2f94b422dba885d
Author: Johann150 <johann@qwertqwefsday.eu>
Date:   Sat, 20 Mar 2021 21:46:52 +0100

parameterize title and clone url

Diffstat:
Mmygit.toml | 3+++
Msrc/main.rs | 2++
Mtemplates/base.html | 2+-
Mtemplates/repo-navbar.html | 2+-
4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/mygit.toml b/mygit.toml @@ -3,4 +3,7 @@ port = 8081 projectroot = "repos" emoji_favicon = "💻" site_name = "My git repositories" +# file to check for in the .git directory to decide wether to publicly show a repo export_ok = "git-daemon-export-ok" +# base directory to clone repositories from +clone_base = "https://git.alexwennerberg.com" diff --git a/src/main.rs b/src/main.rs @@ -25,6 +25,8 @@ pub struct Config { site_name: String, #[serde(default = "defaults::export_ok")] export_ok: String, + #[serde(default = "String::new")] + clone_base: String, } /// Defaults for the configuration options diff --git a/templates/base.html b/templates/base.html @@ -6,7 +6,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=0" /> <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>{{crate::CONFIG.emoji_favicon}}</text></svg>"> <meta name="description" content="My self-hosted git repositories"> - <title>{% block title %}My Site{% endblock %}</title> + <title>{{crate::CONFIG.site_name}}</title> {% block head %}{% endblock %} </head> <body> diff --git a/templates/repo-navbar.html b/templates/repo-navbar.html @@ -1,5 +1,5 @@ <h1><a href="/">index</a>/{{repo|repo_name}}</h1> <div>{{repo|description}}</div> -<div class="clone-url">git clone git.alexwennerberg.com/repo </div> +<div class="clone-url">git clone {{crate::CONFIG.clone_base}}/{{repo|repo_name}} </div> <div class="navbar"><a href="/{{repo|repo_name|urlencode_strict}}">README</a> | <a href="/{{repo|repo_name|urlencode_strict}}/tree">tree</a> | <a href="/{{repo|repo_name|urlencode_strict}}/log">log</a> | <a href="/{{repo|repo_name|urlencode_strict}}/refs">refs</a></div> <hr class='thin'>