templates/index.html (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
{{ define "index" }}
<html>
{{ template "head" . }}
<title>
{{ .meta.Title }}
</title>
<header>
<h1>{{ .meta.Title }}</h1>
<h2>{{ .meta.Description }}</h2>
</header>
<body>
<main>
<div class="index">
{{ range .info }}
{{ if eq (len .Repositories) 1 }}
{{ $repo := (index .Repositories 0) }}
<div class="index-name"><a href="/{{ $repo.Slug }}">{{ $repo.Name }}</a></div>
<div class="desc">{{ $repo.Description }}</div>
<div>{{ $repo.LastCommit }}</div>
{{ end }}
{{ if gt (len .Repositories) 1 }}
<div class="index-category">{{ .Name }}/</div><div></div><div></div>
{{ range .Repositories }}
<div class="index-category-name"><a href="/{{ .Slug }}">{{ .Name }}</a></div>
<div class="desc">{{ .Description }}</div>
<div>{{ .LastCommit }}</div>
{{ end }}
{{ end }}
{{ end }}
</div>
</main>
</body>
</html>
{{ end }}
|