{{- /* Raw HTML in the repository's Markdown reaches the page as written. This policy keeps it from running anything: a script loads only from the site's own /js/ and /pagefind/ folders, which no repository file is served under, so an inline script, an event handler, a javascript: address or a script a concept names cannot run. Frames, plugins and forms are refused. The preview server adds its own reload script, so the policy is left off there. */ -}} {{- if not hugo.IsServer }} {{- end }} {{- $title := partial "title.html" . }} {{- /* The logo: the repository's own, from .assets/, when site.toml names one, else the Knowledge Trust Ladder logo the site carries. */ -}} {{- $logo := "brand/knowledge-trust-ladder-logo.svg" }} {{- $logoDark := "brand/knowledge-trust-ladder-logo-dark.svg" }} {{- with site.Params.logo }}{{ $logo = strings.TrimPrefix "." . }}{{ $logoDark = strings.TrimPrefix "." (site.Params.logoDark | default .) }}{{ end }} {{- $description := .Description | default .Params.description | default site.Params.description }} {{ if .IsHome }}{{ site.Title }}{{ else }}{{ $title }} | {{ site.Title }}{{ end }} {{- with partial "card.html" . }} {{- end }} {{- /* The page as Markdown: a docs page's or the README's with full addresses, a concept's file as the bundle holds it. */ -}} {{- with partialCached "markdown-file.html" . .RelPermalink }} {{- else }}{{ with .Params.conceptId }} {{- end }}{{ end }} {{- with .OutputFormats.Get "jsonld" }} {{- /* The concept's record as data in the page, without its body, which the page already shows. */ -}} {{- $record := dict }} {{- range $k, $v := index (partialCached "jsonld.html" "jsonld") $.Params.concept.id }}{{ if ne $k "body" }}{{ $record = merge $record (dict $k $v) }}{{ end }}{{ end }} {{- with $record }} {{- end }} {{- end }} {{- /* The stylesheets keep one address across builds, so a page the browser kept from before a deploy still finds them. */ -}} {{- $light := css.ChromaStyles (dict "targetPath" "css/code-light.css" "style" "github" "mode" "light") }} {{- $dark := css.ChromaStyles (dict "targetPath" "css/code-dark.css" "style" "github" "mode" "dark") | minify }} {{- $css := slice (resources.Get "css/site.css") $light (resources.Get "css/custom.css") | resources.Concat "css/site.css" | minify }} {{- $js := resources.Get "js/site.js" | minify }}
{{- if ne $logoDark $logo }}{{ end }} {{ site.Title }} {{- /* The Display menu is a popover, so the browser closes it on a click outside it or on Escape. site.js shows its button, which does nothing without the script. */ -}}
{{- range $set := slice (dict "name" "theme" "legend" "Theme" "choices" (slice (slice "auto" "System") (slice "light" "Light") (slice "dark" "Dark"))) (dict "name" "size" "legend" "Text size" "choices" (slice (slice "medium" "Medium") (slice "large" "Large") (slice "larger" "Larger"))) }}
{{ $set.legend }}
{{- range $set.choices }} {{- end }}
{{- end }}
GitHub Menu
{{- /* Search leaves out the release pages and the schema's slots and types, which would outnumber everything else. */ -}} {{- /* A page that retells another has no line in the navigation, so site.js marks the line of the page it retells. */ -}} {{- $retells := "" }} {{- with index (partialCached "levels.html" "levels") .RelPermalink }}{{ with (index . 0).page }}{{ if ne .Path $.Path }}{{ $retells = .RelPermalink }}{{ end }}{{ end }}{{ end }}
{{- partial "tools.html" . }} {{- block "main" . }}{{ end }} {{- /* One empty region on every build, so clean-html.py can tell a build whose marks the minifier dropped. */ -}} {{- if .IsHome }}{{ with site.Params.rawmark }}{{ printf "" . . | safeHTML }}{{ end }}{{ end }} {{- partial "pager.html" . }}
{{- /* The page has the width to itself. Only a concept has something to set beside its words: its neighbours. */ -}} {{- if .Params.conceptId }}{{ partial "neighbourhood.html" . }}{{ end }}
{{- if .Store.Get "hasMermaid" }} {{- with partial "vendor.html" "mermaid" }}{{ end }} {{- end }} {{- block "scripts" . }}{{ end }}