Migration
This is my new public git source viewer. Source coming soon. Please contact with concerns/bugs.
Contact me
templates/views/repo.html
3a50036d96eb14462e96598fd169d1c79264ac4b
· 1.8 KB · 41 lines
raw
| 1 | {{ define "repo.html" }}{{ template "base" . }}{{ end }} |
| 2 | {{ define "main" }} |
| 3 | {{ $slug := print "/" .Info.Slug }} |
| 4 | {{ $m := mod "meta" }} |
| 5 | |
| 6 | <header class="page-head"> |
| 7 | <h1>{{ $m.Title }}</h1> |
| 8 | {{ with $m.Description }}<p class="sub">{{ . }}</p>{{ end }} |
| 9 | </header> |
| 10 | |
| 11 | <dl class="facts"> |
| 12 | <dt>branch</dt><dd><a href="{{ $slug }}/tree/{{ $m.DefaultRef }}"><code>{{ $m.DefaultRef }}</code></a></dd> |
| 13 | <dt>updated</dt><dd>{{ with $m.LastCommit }}<time datetime="{{ rfc3339 . }}">{{ date . }}</time>{{ else }}<span class="muted">never</span>{{ end }}</dd> |
| 14 | {{ with $m.Section }}<dt>section</dt><dd><a href="/#{{ slug . }}">{{ . }}</a></dd>{{ end }} |
| 15 | {{ with $m.Clone }}<dt>clone</dt><dd><code class="clone">{{ . }}</code></dd>{{ end }} |
| 16 | {{ with $m.Owner }}<dt>owner</dt><dd>{{ . }}</dd>{{ end }} |
| 17 | </dl> |
| 18 | |
| 19 | {{/* `with` on the slice, not index 0 -- an empty repo has no commits and |
| 20 | indexing would abort the render. */}} |
| 21 | {{ with mod "log" "1" }}{{ with index . 0 }} |
| 22 | <a class="latest" href="{{ $slug }}/commit/{{ .SHA }}"> |
| 23 | <span class="latest-sha">{{ .Short }}</span> |
| 24 | <span class="latest-subject">{{ trunc 88 .Subject }}</span> |
| 25 | <span class="latest-meta">{{ .Author }} · <time datetime="{{ rfc3339 .When }}">{{ date .When }}</time></span> |
| 26 | </a> |
| 27 | {{ end }}{{ end }} |
| 28 | |
| 29 | {{ with modOr "readme" }} |
| 30 | <div class="prose readme">{{ .HTML }}</div> |
| 31 | {{ else }} |
| 32 | <p class="notice">No README on <code>{{ $.Ref }}</code>. Browse the <a href="{{ $slug }}/tree/{{ $.Ref }}">files</a> instead.</p> |
| 33 | {{ end }} |
| 34 | |
| 35 | {{/* Everything else moved to its own page. Modules are lazy, so the ones |
| 36 | this view no longer calls cost nothing -- to put authors back, this is |
| 37 | the entire change: |
| 38 | {{ with mod "authors" }} |
| 39 | <ul class="chips">{{ range . }}<li class="chip">{{ .Name }} <b>{{ .Commits }}</b></li>{{ end }}</ul> |
| 40 | {{ end }} */}} |
| 41 | {{ end }} |