Migration
This is my new public git source viewer. Source coming soon. Please contact with concerns/bugs.
Contact me
templates/layouts/base.html
3a50036d96eb14462e96598fd169d1c79264ac4b
· 1.6 KB · 45 lines
raw
| 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>{{ block "title" . }}{{ with .Info.Title }}{{ . }} · {{ end }}{{ .Site.Name }}{{ end }}</title> |
| 7 | <link rel="stylesheet" href="/static/style.css"> |
| 8 | </head> |
| 9 | <body> |
| 10 | {{ template "topbar" . }} |
| 11 | <main class="wrap">{{ block "main" . }}{{ end }}</main> |
| 12 | <footer class="wrap"> |
| 13 | <span>{{ .Site.Name }}</span> |
| 14 | <span class="sep">/</span> |
| 15 | <span>served from bare repositories</span> |
| 16 | </footer> |
| 17 | </body> |
| 18 | </html>{{ end }} |
| 19 | |
| 20 | {{ define "topbar" }} |
| 21 | <header class="topbar"> |
| 22 | <div class="wrap bar"> |
| 23 | <a class="brand" href="/">{{ .Site.Name }}</a> |
| 24 | {{ with .Info.Slug }} |
| 25 | <span class="slash">/</span> |
| 26 | <a class="repo" href="/{{ . }}/">{{ $.Info.Title }}</a> |
| 27 | <nav class="tabs"> |
| 28 | <a href="/{{ . }}/tree/{{ $.Ref }}">files</a> |
| 29 | <a href="/{{ . }}/log/{{ $.Ref }}">log</a> |
| 30 | <a href="/{{ . }}/graph/">graph</a> |
| 31 | <a href="/{{ . }}/refs/">refs</a> |
| 32 | </nav> |
| 33 | {{ with modOr "refs" }} |
| 34 | <label class="refpick"> |
| 35 | <span class="sr">Ref</span> |
| 36 | <select onchange="location.href=this.value"> |
| 37 | {{ range .Branches }}<option value="/{{ $.Info.Slug }}/tree/{{ .Name }}"{{ if eq .Name $.Ref }} selected{{ end }}>{{ .Name }}</option>{{ end }} |
| 38 | {{ range .Tags }}<option value="/{{ $.Info.Slug }}/tree/{{ .Name }}"{{ if eq .Name $.Ref }} selected{{ end }}>{{ .Name }}</option>{{ end }} |
| 39 | </select> |
| 40 | </label> |
| 41 | {{ end }} |
| 42 | {{ end }} |
| 43 | </div> |
| 44 | </header> |
| 45 | {{ end }} |