header.partial.tmpl

 1{{define "header"}}
 2<div class="site-header">
 3  <h1 class="site-header__title">
 4    {{if .SiteURLs.HomeURL}}
 5      <a href="{{.SiteURLs.HomeURL}}">repos</a>
 6      <span>/</span>
 7    {{end}}
 8    <span>{{.Repo.RepoName}}</span>
 9  </h1>
10  {{if .Repo.Desc}}<div class="site-header__desc">{{.Repo.Desc}}</div>{{end}}
11
12  <nav class="nav-menu">
13    {{if eq .Active "summary"}}<span class="active">summary</span>{{else}}<a href="{{.SiteURLs.SummaryURL}}">summary</a>{{end}}
14    {{if eq .Active "refs"}}<span class="active">refs</span>{{else}}<a href="{{.SiteURLs.RefsURL}}">refs</a>{{end}}
15    {{if eq .Active "code"}}<span class="active">code</span>{{else}}<a href="{{.RevData.TreeURL}}">code</a>{{end}}
16    {{if eq .Active "commits"}}<span class="active">commits</span>{{else}}<a href="{{.RevData.LogURL}}">commits</a>{{end}}
17    {{if .SiteURLs.IssuesURL}}{{if eq .Active "issues"}}<span class="active">issues</span>{{else}}<a href="{{.SiteURLs.IssuesURL}}">issues</a>{{end}}{{end}}
18    <details class="nav-menu__ref-selector">
19      <summary>{{.RevData.Name}}</summary>
20      <div class="ref-selector__dropdown">
21        {{range .Refs}}{{if .URL}}<a href="{{.URL}}">{{.Refspec}}</a>{{end}}{{end}}
22      </div>
23    </details>
24  </nav>
25
26  {{if and (eq .Active "summary") .LastCommit}}
27  <div class="last-commit-bar">
28    <div class="last-commit-bar__info">
29        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-git-commit-horizontal-icon lucide-git-commit-horizontal"><circle cx="12" cy="12" r="3"/><line x1="3" x2="9" y1="12" y2="12"/><line x1="15" x2="21" y1="12" y2="12"/></svg>
30      <span class="font-bold">{{.LastCommit.AuthorStr}}</span>
31      <span>&nbsp;&centerdot;&nbsp;</span>
32      <a href="{{.LastCommit.URL}}">{{.LastCommit.SummaryStr}}</a>
33    </div>
34    <div class="last-commit-bar__time">
35      <span class="human-time" data-time="{{.LastCommit.WhenISO}}">{{.LastCommit.WhenDisplay}}</span>
36    </div>
37  </div>
38  {{end}}
39</div>
40{{end}}