major refactor, card pagination beta testing
[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 {{- $sc := cond (or (not $sp.Params.caption)) (cond (not .Site.Home.Params.caption) .Site.Title .Site.Home.Params.caption) $sp.Params.caption }}
16 {{- $ph := cond (or (not .Params.header) (not (fileExists (printf "static/%s" .Params.header)))) $sh .Params.header }}
17 <img src="{{ $ph }}">
18 <div>
19 {{ $caption := cond (not .Params.caption) $sc .Params.caption }}
20 {{- if (eq (printf "%T" $caption) "string") }}
21 {{- $caption -}}
22 {{- else }}
23 {{- index $caption 0 }}
24 {{- if (gt (len $caption) 1) }}
25 {{- range after 1 $caption -}}
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>{{ .Name }}</summary>
39 <svg{{- if or ($pg.InSection .Page) (eq .Page $pg) }} class="selected"{{ end }}>
40 <use xlink:href="{{ relURL `/img/nav.svg` | safeHTML }}#{{ .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>