</head>
<body>
<header>
- <figure>
- {{- $ph := .Page.Resources.GetMatch "header.png" -}}
- {{- if $ph }}
- <img src="{{ $ph.RelPermalink }}"></img>
+ {{- $sp := .Site.GetPage "section" .Section }}
+ {{- $ph := .Page.Resources.GetMatch "header.png" -}}
+ {{- $ph := cond (not $ph) ($sp.Resources.GetMatch "header.png") $ph }}
+ {{- $ph := cond (not $ph) (relURL "/img/speedy.png") $ph.RelPermalink }}
+ <img src="{{ $ph }}">
+ <div>
+ {{ $caption := cond (not .Page.Params.caption) (cond (not $sp.Params.caption) .Site.Title $sp.Params.caption) .Page.Params.caption }}
+ {{- if (eq (printf "%T" $caption) "string") }}
+ {{- $caption -}}
{{- else }}
- <img src="{{relURL `/img/speedy.png`}}"></img>
+ {{- index $caption 0 }}
+ {{- if (gt (len $caption) 1) }}
+ {{- range after 1 $caption -}}
+ <br>
+ {{ . }}
+ {{- end -}}
+ {{- end -}}
{{- end }}
- </figure>
- <nav>
- <header>{{ if .Page.Title }}{{ .Page.Title }}{{ else }} {{ end }}</header>
- <nav>
- {{- $pg := . }}
- {{- range union (where .Site.Menus.main "Weight" 0).Reverse (where .Site.Menus.main "Weight" "!=" 0) }}
- {{- if or ($pg.IsMenuCurrent "main" .) ($pg.HasMenuCurrent "main" .) }}
- <svg class="selected"><use xlink:href="{{ relURL `/img/nav.svg` }}#{{ .Name }}"/></svg>
- {{- else }}
- <a href="{{ .URL }}">
- <summary>{{ .Name }}</summary>
- <svg><use xlink:href="{{ relURL `/img/nav.svg` }}#{{ .Name }}"/></svg>
- </a>
- {{- end }}
- {{- end }}
- </nav>
- <footer>
- {{- if isset .Page.Params "caption" -}}
- {{- if (eq (printf "%T" .Page.Params.caption) "string") }}
- {{- replaceRE "([&<>'])" "$1" .Page.Params.caption -}}
- {{- else }}
- {{ replaceRE "([&<>'])" "$1" (index .Page.Params.caption 0) }}
- {{- range after 1 .Page.Params.caption -}}
- <br>
- {{ replaceRE "([&<>'])" "$1" . }}
- {{- end }}
- {{- end }}
- {{- else }}
- {{- .Site.Title -}}
- {{- end }}
- </footer>
- </nav>
+ </div>
</header>
+ <nav>
+ <div>
+ {{- $pg := . }}
+ {{- range union (where .Site.Menus.main "Weight" 0).Reverse (where .Site.Menus.main "Weight" "!=" 0) }}
+ <a href="{{ .URL }}">
+ <summary>{{ .Name }}</summary>
+ <svg{{- if or ($pg.InSection .Page) (eq .Page $sp) }} class="selected"{{ end }}>
+ <use xlink:href="{{ relURL `/img/nav.svg` }}#{{ .Name }}"/>
+ </svg>
+ </a>
+ {{- end }}
+ </div>
+ <footer>
+ {{ cond (not .Page.Title) .Page.Name .Page.Title }}
+ </footer>
+ </nav>
<main>
{{ block "main" . }}{{ end }}
</main>