home.gohtml
1879 bytes
1{{ define "base" }}<!doctype html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>{{ .ServerName }}</title>
7 <link rel="stylesheet" href="/@/assets/site.css">
8</head>
9<body>
10 {{ template "site-header" . }}
11 <main class="page-shell">
12 {{ template "home-content" . }}
13 </main>
14</body>
15</html>{{ end }}
16
17{{ define "home" }}{{ template "base" . }}{{ end }}
18
19{{ define "home-content" }}
20 {{ if .Profile }}
21 <section class="panel profile" aria-labelledby="profile-heading">
22 <h2 id="profile-heading">About {{ .ServerName }}</h2>
23 <div class="markdown">{{ .Profile }}</div>
24 </section>
25 {{ end }}
26 <section class="project-section" aria-labelledby="projects-heading">
27 <div class="section-heading">
28 <div><h2 id="projects-heading">Projects</h2></div>
29 {{ if .Cards }}<span class="item-count">{{ len .Cards }} available</span>{{ end }}
30 </div>
31 {{ if .Cards }}
32 <ul class="repository-list">
33 {{ range .Cards }}
34 <li>
35 <a class="repository-card" href="{{ .URL }}">
36 <div class="repository-card-content">
37 <h3>{{ .Title }}</h3>
38 {{ if ne .Title .Name }}<p class="repository-name">{{ .Name }}</p>{{ end }}
39 {{ if .Description }}<p class="repository-description">{{ .Description }}</p>{{ end }}
40 </div>
41 <div class="repository-card-meta">
42 {{ if .BuildStatus.Present }}<span class="build-status">Build: <span class="status-badge {{ .BuildStatus.Class }}">{{ .BuildStatus.Label }}</span></span>{{ end }}
43 {{ if .UpdatedAt }}<time class="updated">Updated {{ .UpdatedAt }}</time>{{ end }}
44 </div>
45 </a>
46 </li>
47 {{ end }}
48 </ul>
49 {{ else }}
50 <p class="empty-state">No public projects are available.</p>
51 {{ end }}
52 </section>
53{{ end }}