A minimal self-hosted git browser on Rust axum: bare repos rendered as a website with commits, diffs, syntax-highlighted blobs, atom feeds, and clone over HTTPS.
axumdockergitgit-browsergitoxidegixrustself-hosted
1<!doctype html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>{% block title %}{% endblock %}{% if self.title() %} · {% endif %}{{ site.title }}</title>
7 <meta name="description" content="{% block description %}minimal git repo browser{% endblock %}">
8 {% if base_url %}<base href="{{ base_url }}">{% endif %}
9 <link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
10 {% block extra_head %}{% endblock %}
11 <link href="{{ vite_asset('static_src/index.js', 'css') }}" rel="stylesheet">
12</head>
13<body>
14 <header class="topbar">
15 <div class="container topbar__row">
16 <a class="brand" href="/">
17 <span class="brand-mark" aria-hidden="true">
18 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
19 <line x1="22" y1="14" x2="22" y2="50" stroke="currentColor" stroke-width="3" stroke-linecap="round"/>
20 <line x1="22" y1="32" x2="44" y2="50" stroke="currentColor" stroke-width="3" stroke-linecap="round"/>
21 <circle cx="22" cy="14" r="6" fill="currentColor"/>
22 <circle cx="22" cy="32" r="6" fill="currentColor"/>
23 <circle cx="22" cy="50" r="6" fill="currentColor"/>
24 <circle cx="44" cy="50" r="6" fill="currentColor"/>
25 </svg>
26 </span>
27 <span class="brand-text">{{ site.title }}</span>
28 </a>
29 {% if site.tagline %}
30 <span class="topbar__divider" aria-hidden="true"></span>
31 <span class="tagline">{{ site.tagline }}</span>
32 {% endif %}
33 <nav class="topnav" aria-label="primary">
34 <a href="/" class="topnav__link {% if request.path == '/' %}is-active{% endif %}">
35 <span class="topnav__dot" aria-hidden="true"></span>repos
36 </a>
37 </nav>
38 </div>
39 </header>
40
41 {% block breadcrumbs %}{% endblock %}
42
43 <main>
44 <div class="container">
45 {% block main %}{% endblock %}
46 </div>
47 </main>
48
49 <footer class="footer">
50 <div class="container footer__grid">
51 <div class="footer__about">
52 <div class="footer__label">// {{ site.title }}</div>
53 <p>Minimal git repo browser by
54 <a href="https://isaacbythewood.com/">Isaac Bythewood</a>.
55 Just enough chrome to read code: README and recent commits, tree
56 and blob browsing with syntax highlighting, unified diffs per
57 commit, and an Atom feed. Clone over HTTPS. Read-only,
58 single-operator, no Github required.</p>
59 {% if site.tagline %}<p class="footer__tagline">{{ site.tagline }}.</p>{% endif %}
60 </div>
61 <div class="footer__col">
62 <div class="footer__label">// Pages</div>
63 <ul>
64 <li><a href="/">Repos</a></li>
65 <li><a href="https://github.com/overshard/repos-rust" target="_blank" rel="noopener">Source</a></li>
66 </ul>
67 </div>
68 </div>
69 </footer>
70
71 <div class="footer-bar">
72 <div class="container footer-bar__row">
73 <small>© {{ now.year }} Isaac Bythewood · Some rights reserved</small>
74 <a href="https://github.com/overshard/repos-rust" target="_blank" rel="noopener" class="footer-bar__link" aria-label="GitHub">
75 <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" viewBox="0 0 16 16">
76 <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
77 </svg>
78 </a>
79 </div>
80 </div>
81
82 <script type="module" src="{{ vite_asset('static_src/index.js') }}"></script>
83</body>
84</html>