optimization pass
[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="/css/speedy.css">
6 <script src="/js/speedy.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 {{- $sh := cond (or (not $sp.Params.header) (not (fileExists (printf "static/%s" $sp.Params.header)))) (cond (or (not .Site.Home.Params.header) (not (fileExists (printf "static/%s" .Site.Home.Params.header)))) "/img/speedy.png" .Site.Home.Params.header) $sp.Params.header }}
15 {{- $ph := cond (or (not .Params.header) (not (fileExists (printf "static/%s" .Params.header)))) $sh .Params.header }}
16 <img src="{{ $ph }}">
17 <div>
18 {{- if not .Page.Params.heading }}
19 {{ .Page.Title }}
20 {{- else if eq (printf "%T" .Page.Params.heading) "string" }}
21 {{ .Page.Params.heading }}
22 {{- else }}
23 {{- index .Page.Params.heading 0 }}
24 {{- if (gt (len .Page.Params.heading) 1) }}
25 {{- range after 1 .Page.Params.heading -}}
26 <br>
27 {{ . }}
28 {{- end -}}
29 {{- end -}}
30 {{- end }}
31 </div>
32 </header>
33 <nav>
34 <div>
35 {{- $pg := . }}
36 {{- range .Site.Menus.main }}
37 <a href="{{ absURL .URL }}">
38 <summary>{{ .Title }}</summary>
39 <svg{{- if or ($pg.InSection .Page) (eq .Page $pg) }} class="selected"{{ end }}>
40 <use xlink:href="{{ relURL `/img/nav.svg` | safeHTML }}#{{ .Title }}"/>
41 </svg>
42 </a>
43 {{- end }}
44 </div>
45 <footer>
46 {{ cond (not $sp.Params.menu.main.title) $sp.Title $sp.Params.menu.main.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>