{{- /*
Self-hosted fonts: Jersey 10 for headings and Hack for everything else (assets/fonts, licences in
static/fonts). Their @font-face rules are generated from assets/css/fonts.css.tmpl instead of
being part of the main stylesheet. A web font that arrives after the first paint swaps in and
moves the page: Jersey 10 is far narrower than the monospace fallback, so the heading chips
changed their width, and the page transition made that visible on every language switch.
- The Latin subset of Jersey 10 is embedded in the stylesheet, so it is there at the first paint
whatever the connection, and without a request that the browser would have to revalidate.
- Hack is preloaded, so the body text is not first drawn in a fallback font of a different
character width (SF Mono in Safari, Consolas on Windows). Its URL here and in @font-face come
from the same fingerprinted resource, so they are identical (and correct below a sub path, as
on the PR previews).
*/ -}}
{{- with resources.Get "css/fonts.css.tmpl" | resources.ExecuteAsTemplate "css/fonts.tmpl.css" . }}
{{- /* The executed template has no media type (from ".tmpl"), which minify needs. */ -}}
{{- with resources.FromString "css/fonts.css" .Content | minify | fingerprint }}
{{- end }}
{{- end }}
{{- range slice "Hack-Regular" "Hack-Bold" }}
{{- with resources.Get (printf "fonts/%s.woff2" .) | fingerprint }}
{{- end }}
{{- end }}