<header>
{{- $sp := .Site.GetPage "section" .Section }}
{{- $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 }}
- {{- $sc := cond (or (not $sp.Params.caption)) (cond (not .Site.Home.Params.caption) .Site.Title .Site.Home.Params.caption) $sp.Params.caption }}
{{- $ph := cond (or (not .Params.header) (not (fileExists (printf "static/%s" .Params.header)))) $sh .Params.header }}
<img src="{{ $ph }}">
<div>
- {{ $caption := cond (not .Params.caption) $sc .Params.caption }}
- {{- if (eq (printf "%T" $caption) "string") }}
- {{- $caption -}}
+ {{- if not .Page.Params.heading }}
+ {{ .Page.Title }}
+ {{- else if eq (printf "%T" .Page.Params.heading) "string" }}
+ {{ .Page.Params.heading }}
{{- else }}
- {{- index $caption 0 }}
- {{- if (gt (len $caption) 1) }}
- {{- range after 1 $caption -}}
+ {{- index .Page.Params.heading 0 }}
+ {{- if (gt (len .Page.Params.heading) 1) }}
+ {{- range after 1 .Page.Params.heading -}}
<br>
{{ . }}
{{- end -}}
{{- $pg := . }}
{{- range .Site.Menus.main }}
<a href="{{ absURL .URL }}">
- <summary>{{ .Name }}</summary>
+ <summary>{{ .Title }}</summary>
<svg{{- if or ($pg.InSection .Page) (eq .Page $pg) }} class="selected"{{ end }}>
- <use xlink:href="{{ relURL `/img/nav.svg` | safeHTML }}#{{ .Name }}"/>
+ <use xlink:href="{{ relURL `/img/nav.svg` | safeHTML }}#{{ .Title }}"/>
</svg>
</a>
{{- end }}
</div>
<footer>
- {{ cond (not .Page.Title) .Page.Name .Page.Title }}
+ {{ cond (not $sp.Params.menu.main.title) $sp.Title $sp.Params.menu.main.title }}
</footer>
</nav>
<main>
{{- define "main" -}}
{{- if (gt (len (findRE "<h1" .Content)) 0) }}
<article>
- {{ replaceRE "(<h1.*</h1>)" "</article>\n$1\n<article>" .Content | strings.TrimLeft "\n " | replaceRE "\n" "\n " | safeHTML }}
+ {{ replaceRE "(<h1.*</h1>)" "</article>\n$1\n<article>" .Content | strings.TrimLeft "\n " | safeHTML }}
{{- else -}}
<article>
{{ .Content | replaceRE "\n" "\n " | safeHTML }}
<div style="font-size: 0.5em; float: right;">{{ .Params.categories }}</div>
<div>{{ .PublishDate.Format "January 2 2006" }}</div>
{{.Title}}
+ {{ if .Params.caption }}
+ {{- if (eq (printf "%T" .Params.caption) "string") }}
+ {{- .Params.caption -}}
+ {{- else }}
+ {{- index .Params.caption 0 }}
+ {{- if (gt (len .Params.caption) 1) }}
+ {{- range after 1 .Params.caption -}}
+ <br>
+ {{ . }}
+ {{- end -}}
+ {{- end -}}
+ {{- end }}
+ {{ else }}
<div>{{ truncate 100 .Summary }}</div>
+ {{- end }}
</a><br>
font-size: 1.66em;
}
h2 {
+ text-align: center;
text-decoration: underline;
- font-size: 1.33em;
+ font-size: 1.48em;
+}
+h3 {
+ text-align: center;
+ font-size: 1.32em;
+}
+h4 {
+ text-align: center;
+ font-size: 1.24em;
}
body {
margin: 0;
}
body > main {
margin: 0 1vw;
- font-size: calc(10pt + 0.25vw); /* at least 60 chars wide */
- /* font-size: 1.8rem; */
- font-family: sans;
+ font-size: calc(11pt + 0.22vw);
+ font-family: sans-serif;
+ overflow: hidden;
}
body > footer {
font-size: 0.8rem;
.center {
text-align: center;
}
+.center-justify {
+ display: flex;
+ justify-content: center;
+}
+.float-right {
+ float: right;
+}
+.float-left {
+ float: left;
+}
+pre {
+ display: block;
+ border-radius: 3px;
+ background-color: white;
+ box-shadow: 1px 1px 1px black;
+}
+article > code,
+article > p > code,
+article > ol > li > code,
+article > ul > li > code {
+ border-radius: 3px;
+ background-color: white;
+ box-shadow: 1px 1px 1px black;
+}
+table {
+ display: block;
+}
@media screen and (orientation:landscape) {
body > main > article {
margin: 1vh 1vw 1vw 1vh;
const navUp = () => nav.style.top = Math.min(parseInt(nav.style.top,10) + (oldScrollY - window.scrollY), 0) + 'px'
const navDown = () => nav.style.top = Math.max(parseInt(nav.style.top,10) - (window.scrollY - oldScrollY), -nav.offsetHeight) + 'px'
nav.style.top = 0 + 'px'
- window.onscroll = () => {
+ const navUpdate = () => {
if (window.matchMedia("(orientation: portrait)").matches) {
if (window.scrollY < oldScrollY) /* up */ {
if (upDelay-- <= 0)
}
oldScrollY = window.scrollY
}
+ window.requestAnimationFrame(navUpdate)
}
+ navUpdate();
}
const resizeIFrame = (iframe) => {