base.html

 1{{define "layout"}}
 2<!DOCTYPE html>
 3<html lang="en">
 4<head>
 5  <meta charset="UTF-8">
 6  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 7  <meta name="color-scheme" content="light dark">
 8  <title>{{if .Repo}}{{if .Repo.ProjectName}}{{.Repo.ProjectName}}{{else}}{{.Repo.Name}}{{end}}{{else}}{{.ServerName}}{{end}}</title>
 9  {{if .Repo}}{{if .Repo.Description}}<meta name="description" content="{{.Repo.Description}}">{{end}}{{end}}
10  <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🍦</text></svg>">
11
12  <link rel="stylesheet" href="/static/syntax.css">
13</head>
14<body class="container">
15  <a href="#main-content" class="skip-link">Skip to main content</a>
16
17  <header>
18    <nav aria-label="Site navigation">
19      <ul>
20        <li><strong>{{.ServerName}}</strong></li>
21      </ul>
22      <ul>
23        <li><a href="/"{{if eq .ActiveTab "repositories"}} aria-current="page"{{end}}>Repositories</a></li>
24        <li><a href="/about"{{if eq .ActiveTab "about"}} aria-current="page"{{end}}>About</a></li>
25      </ul>
26    </nav>
27    {{if .Repo}}
28    <nav aria-label="Repository navigation">
29      <ul>
30        <li>
31          {{if .Repo.Description}}
32          <hgroup>
33            <h1>{{if .Repo.ProjectName}}{{.Repo.ProjectName}}{{else}}{{.Repo.Name}}{{end}}</h1>
34            <p>{{.Repo.Description}}</p>
35          </hgroup>
36          {{else}}
37          <h1>{{if .Repo.ProjectName}}{{.Repo.ProjectName}}{{else}}{{.Repo.Name}}{{end}}</h1>
38          {{end}}
39        </li>
40      </ul>
41      <ul>
42        <li><a href="/{{.Repo.Name}}"{{if eq .ActiveTab "overview"}} aria-current="page"{{end}}>README</a></li>
43        <li><a href="/{{.Repo.Name}}/tree/{{.DefaultBranch}}"{{if eq .ActiveTab "tree"}} aria-current="page"{{end}}>Files</a></li>
44        <li><a href="/{{.Repo.Name}}/commits/{{.DefaultBranch}}"{{if eq .ActiveTab "commits"}} aria-current="page"{{end}}>Commits</a></li>
45        <li><a href="/{{.Repo.Name}}/branches"{{if eq .ActiveTab "branches"}} aria-current="page"{{end}}>Branches</a></li>
46        <li><a href="/{{.Repo.Name}}/tags"{{if eq .ActiveTab "tags"}} aria-current="page"{{end}}>Tags</a></li>
47      </ul>
48    </nav>
49    {{end}}
50  </header>
51
52  <main id="main-content">
53    {{template "content" .}}
54  </main>
55
56  <footer>
57    <p>Powered by <a href="https://github.com/charmbracelet/soft-serve">Soft Serve</a></p>
58  </footer>
59</body>
60</html>
61{{end}}