main pgit / html / tree.page.tmpl
Eric Bower  ·  2026-05-16
 1{{template "base" .}}
 2
 3{{define "title"}}files - {{.Repo.RepoName}}@{{.RevData.Name}}{{end}}
 4{{define "meta"}}{{end}}
 5
 6{{define "content"}}
 7  <div class="box sticky flex items-center gap border-visited flex-wrap">
 8    <code>{{.RevData.Name}}</code>
 9
10    {{range .Tree.Crumbs}}
11      {{if .IsLast}}
12        <span class="font-bold">{{.Text}}</span>
13      {{else}}
14        <a href="{{.URL}}">{{.Text}}</a> {{if .IsLast}}{{else}}<span>/</span>{{end}}
15      {{end}}
16    {{end}}
17  </div>
18
19  <div class="box" style="padding: 0 !important;">
20    {{range .Tree.Items}}
21      <div class="flex justify-between items-center gap-2 py px tree-row border-b">
22        <div class="flex-1 tree-path flex items-center gap">
23          {{if .IsDir}}
24            <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="16" width="16" viewBox="0 0 512 512">
25              <path d="M0 96C0 60.7 28.7 32 64 32H196.1c19.1 0 37.4 7.6 50.9 21.1L289.9 96H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM64 80c-8.8 0-16 7.2-16 16V416c0 8.8 7.2 16 16 16H448c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16H286.6c-10.6 0-20.8-4.2-28.3-11.7L213.1 87c-4.5-4.5-10.6-7-17-7H64z"/>
26            </svg>
27          {{else}}
28            <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="16" width="16" viewBox="0 0 384 512">
29              <path d="M320 464c8.8 0 16-7.2 16-16V160H256c-17.7 0-32-14.3-32-32V48H64c-8.8 0-16 7.2-16 16V448c0 8.8 7.2 16 16 16H320zM0 64C0 28.7 28.7 0 64 0H229.5c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64z"/>
30            </svg>
31          {{end}}
32
33          <a href="{{.URL}}">{{.Name}}</a>
34        </div>
35
36        <div class="flex items-center gap">
37          {{if $.Repo.HideTreeLastCommit}}
38          {{else}}
39          <div class="flex-1 tree-commit">
40            <a href="{{.CommitURL}}" title="{{.Summary}}">{{.When}}</a>
41          </div>
42          {{end}}
43          <div class="tree-size">
44            {{if .IsDir}}
45            {{else}}
46              {{if .IsTextFile}}{{.NumLines}} L{{else}}{{.Size}}{{end}}
47            {{end}}
48          </div>
49        </div>
50      </div>
51    {{end}}
52  </div>
53{{end}}