545589101371e8ed6b7d2d647d62556cc99a1ad6
[kengrimes.com/theme.git] / layouts / _default / baseof.html
1 <!doctype html>
2 <html>
3 <head>
4 <title>{{ .Site.Title }}{{ if .Page.Title }} :: {{ .Page.Title }}{{ end }}</title>
5 <link rel="stylesheet" href="{{relURL `/css/main.css`}}">
6 <script src="{{relURL `/js/main.js`}}"></script>
7 <meta charset="utf-8" />
8 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
9 {{ .Hugo.Generator }}
10 </head>
11 <body>
12 <header>
13 {{- $sp := .Site.GetPage "section" .Section }}
14 {{- $ph := .Page.Resources.GetMatch "header.png" -}}
15 {{- $ph := cond (not $ph) ($sp.Resources.GetMatch "header.png") $ph }}
16 {{- $ph := cond (not $ph) (relURL "/img/speedy.png") $ph.RelPermalink }}
17 <img src="{{ $ph }}">
18 <div>
19 {{ $caption := cond (not .Page.Params.caption) (cond (not $sp.Title) .Site.Title $sp.Title) .Page.Params.Caption }}
20 {{- if (eq (printf "%T" $caption) "string") }}
21 {{- .Page.Params.caption -}}
22 {{- else }}
23 {{- index .Page.Params.caption 0 }}
24 {{- if (gt (len .Page.Params.caption) 1) }}
25 {{- range after 1 .Page.Params.caption -}}
26 <br>
27 {{ . }}
28 {{- end -}}
29 {{- end -}}
30 {{- end }}
31 </div>
32 </header>
33 <nav>
34 <div>
35 {{- $pg := . }}
36 {{- range union (where .Site.Menus.main "Weight" 0).Reverse (where .Site.Menus.main "Weight" "!=" 0) }}
37 <a href="{{ .URL }}">
38 <summary>{{ .Name }}</summary>
39 <svg{{- if or ($pg.InSection .Page) (eq .Page $sp) }} class="selected"{{ end }}>
40 <use xlink:href="{{ relURL `/img/nav.svg` }}#{{ .Name }}"/>
41 </svg>
42 </a>
43 {{- end }}
44 </div>
45 <footer>
46 {{ cond (not .Page.Title) .Page.Name .Page.Title }}
47 </footer>
48 </nav>
49 <main>
50 {{ block "main" . }}{{ end }}
51 </main>
52 <footer>
53 <p>&copy;{{ .Site.Copyright }}</p>
54 </footer>
55 </body>
56 </html>