Migration
This is my new public git source viewer. Source coming soon. Please contact with concerns/bugs.
Contact me
templates/views/index.html
3a50036d96eb14462e96598fd169d1c79264ac4b
· 1.1 KB · 26 lines
raw
| 1 | {{ define "index.html" }}{{ template "base" . }}{{ end }} |
| 2 | {{ define "main" }} |
| 3 | {{ $secs := mod "sections" }} |
| 4 | <header class="page-head"> |
| 5 | <h1>{{ .Site.Name }}</h1> |
| 6 | <p class="sub">{{ len (mod "repos") }} repositories{{ if gt (len $secs) 1 }} in {{ len $secs }} sections{{ end }}</p> |
| 7 | </header> |
| 8 | |
| 9 | {{ range $secs }} |
| 10 | {{/* An unnamed section means gsg.section is unset everywhere: render flat. */}} |
| 11 | {{ with .Name }}<h2 id="{{ slug . }}">{{ . }}</h2>{{ end }} |
| 12 | <table class="listing repos"> |
| 13 | <tbody> |
| 14 | {{ range .Repos }} |
| 15 | <tr> |
| 16 | <td class="name"><a href="/{{ .Slug }}/">{{ .Title }}</a></td> |
| 17 | <td class="desc">{{ with .Description }}{{ . }}{{ else }}<span class="muted">No description set</span>{{ end }}</td> |
| 18 | <td class="when">{{ with .LastCommit }}<time datetime="{{ rfc3339 . }}">{{ date . }}</time>{{ else }}<span class="muted">empty</span>{{ end }}</td> |
| 19 | </tr> |
| 20 | {{ else }} |
| 21 | <tr><td class="empty">No repositories yet. Create a bare repo under the configured root.</td></tr> |
| 22 | {{ end }} |
| 23 | </tbody> |
| 24 | </table> |
| 25 | {{ end }} |
| 26 | {{ end }} |