caddy-git-server
Caddy module that provides a git server.
<!DOCTYPE html>
<html class="h-full bg-gray-100">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
<title>{{.Name}}{{ if ne .Page "home" }} - {{.Page}}{{ end }} - {{.Host}}</title>
</head>
<body class="bg-gray-100">
<!-- full-width container with bg -->
<div class="bg-white shadow-sm">
<!-- Header -->
<div class="px-8 pt-2 mb-4 2xl:px-0 max-w-7xl mx-auto">
<div class="flex flex-wrap justify-between items-center">
<p class="text-2xl">{{ .Name }}</p>
<p class="font-mono text-xs bg-gray-200 px-1 hidden sm:block"><span class="text-orange-600">git</span> clone <span class="select-all font-bold">{{ .CloneURL }}</span></p>
</div>
<div class="flex flex-wrap justify-between items-center">
<p class="font-xs text-gray-500">{{.Tagline}}</p>
<select class="px-4">
<option>main</option>
<option>master</option>
<option>trunk</option>
<option>reallylongbranchname</option>
</select>
</div>
<div class="flex flex-row flex-nowrap justify-start">
<a href="/{{.Name}}/tree"><div class="cursor-pointer px-2 pt-1 {{if or (or (eq .Page "tree") (eq .Page "home")) (eq .Page "blob") }}border-orange-400 {{else}}hover:{{end}}border-b-2">Tree</div></a>
<a href="/{{.Name}}/log"><div class="cursor-pointer px-2 pt-1 {{if eq .Page "log" }}border-orange-400 {{else}}hover:{{end}}border-b-2">Log</div></a>
{{ if eq 1 2 }}<div class="cursor-default px-2 pt-1 {{if eq .Page "Diff" }}border-orange-400 {{else}}hover:{{end}}border-b-2">Diff</div>{{end}}
</div>
</div>
</div>
<!-- max-width content container -->
<div class="max-w-7xl mx-auto">
{{ template "page" . }}
</div>
<!-- Footer -->
<div class="mt-4 sticky top-[100vh]">
<div class="px-3 py-2 text-md text-center">
Served with
<img src="/assets/cgs-icon.png" class="size-6 inline mx-1">
<a href="https://git.mckinnon.ninja/caddy-git-server" class="font-medium underline">
caddy-git-server
</a>
</div>
</div>
</body>
</html>