1{{define "content"}}
 2<nav aria-label="breadcrumb">
 3  <ul>
 4    <li><a href="/{{.Repo.Name}}">{{.Repo.Name}}</a></li>
 5    {{if ne .Path "."}}
 6    <li><a href="/{{.Repo.Name}}/tree/{{.Ref}}">{{.Ref | shortHash}}</a></li>
 7    {{range $i, $part := splitPath .Path}}
 8    <li><a href="/{{$.Repo.Name}}/tree/{{$.Ref}}/{{joinPath $i $}}">{{$part}}</a></li>
 9    {{end}}
10    {{else}}
11    <li>{{.Ref | shortHash}}</li>
12    {{end}}
13  </ul>
14</nav>
15
16<section aria-labelledby="file-list-heading">
17  <h2 id="file-list-heading">File tree</h2>
18  {{if .Entries}}
19  <table aria-label="Directory contents">
20    <thead>
21      <tr>
22        <th scope="col">Name</th>
23        <th scope="col">Size</th>
24      </tr>
25    </thead>
26    <tbody>
27      {{if ne .Path "."}}
28      <tr>
29        <td><a href="/{{.Repo.Name}}/tree/{{.Ref}}/{{parentPath .Path}}" aria-label="Parent directory">..</a></td>
30        <td aria-label="Directory">-</td>
31      </tr>
32      {{end}}
33      {{range .Entries}}
34      <tr>
35        <td>
36          <a href="/{{$.Repo.Name}}/{{if .IsTree}}tree{{else}}blob{{end}}/{{$.Ref}}/{{if ne $.Path "."}}{{$.Path}}/{{end}}{{.Name}}"{{if .IsTree}} aria-label="Directory: {{.Name}}"{{else}} aria-label="File: {{.Name}}"{{end}}>
37            {{.Name}}{{if .IsTree}}/{{end}}
38          </a>
39        </td>
40        <td>{{if .IsTree}}-{{else}}{{.Size | humanizeSize}}{{end}}</td>
41      </tr>
42      {{end}}
43    </tbody>
44  </table>
45  {{else}}
46  <p>Empty directory</p>
47  {{end}}
48</section>
49{{end}}