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{% extends "base.html" %}
2{% block title %}{{ repo.name }}{% endblock %}
3
4{% block breadcrumbs %}
5<div class="breadcrumbs">
6 <div class="container">
7 <a href="/">repos</a> / <strong>{{ repo.name }}</strong>
8 </div>
9</div>
10{% endblock %}
11
12{% block main %}
13<section class="repo-head">
14 <div class="repo-head__title-row">
15 <h1>{{ repo.name }}</h1>
16 <span class="repo-head__branch">{{ repo.default_branch }}</span>
17 </div>
18 {% if repo.description %}<p class="repo-head__desc">{{ repo.description }}</p>{% endif %}
19 <div class="clone-box">
20 <label>clone</label>
21 <input type="text" readonly value="git clone {{ repo.clone_url }}">
22 </div>
23 <nav class="repo-nav">
24 <a href="/{{ repo.name }}">overview</a>
25 <a href="/{{ repo.name }}/tree/{{ repo.default_branch }}">tree</a>
26 <a href="/{{ repo.name }}/log">log</a>
27 <a href="/{{ repo.name }}/atom.xml">atom</a>
28 </nav>
29</section>
30
31<div class="two-col">
32 <section class="col-main">
33 {% if readme_html %}
34 <article class="readme">{{ readme_html }}</article>
35 {% else %}
36 <p class="empty">No README in this repo.</p>
37 {% endif %}
38 </section>
39
40 <aside class="col-side">
41 <h2 class="side-h">recent commits</h2>
42 {% if commits %}
43 <ul class="commit-list">
44 {% for c in commits %}
45 <li>
46 <a class="sha" href="/{{ repo.name }}/commit/{{ c.id }}">{{ c.short_id }}</a>
47 <span class="summary">{{ c.summary }}</span>
48 <span class="meta">{{ c.author }} · {{ c.time|naturaltime }}</span>
49 </li>
50 {% endfor %}
51 </ul>
52 <p><a href="/{{ repo.name }}/log">all commits →</a></p>
53 {% else %}
54 <p class="empty">No commits yet.</p>
55 {% endif %}
56 </aside>
57</div>
58{% endblock %}