mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 21:36:40 -10:00
devvm.dev and next.devvm.dev loaded Instrument Sans and Martian Mono from Google Fonts, with preconnects to fonts.googleapis.com and fonts.gstatic.com. They were the site's only automatic third-party loads; both fonts are now served from docs/static/fonts/ with their OFL, and a lint:docs check keeps it that way. - Instrument Sans: Instrument/instrument-sans at commit 7fa22308a3d0c94ee2b3cd537a1196b65db34a3e, fonts/webfonts/ InstrumentSans[wdth,wght].woff2 (88,784 B, sha256 aa72922a...826d) and InstrumentSans-Italic[wdth,wght].woff2 (94,888 B, sha256 e958f71f...9ba5), OFL.txt (sha256 9e27a72e...f966). - Martian Mono: evilmartians/mono release v1.1.0 (commit 8ffa86c2), martian-mono-1.1.0-variable.zip (sha256 b8773097...0867), its MartianMonoVF.woff2 (83,044 B, sha256 7cdf8e98...238a, wdth 75-112.5 for the code's font-stretch), the commit's OFL.txt (sha256 ddafd2c3...c256). - head-end.html: @font-face for each with font-display: swap and the same family names, a preload for the upright Instrument Sans, and a comment recording every font's source, pin and full SHA-256s, Departure Mono's included. - TestNoThirdPartyLoads (internal/cli/docgen/site_test.go): lint:docs runs it on the site it builds (DOCS_SITE); it fails on any link, script, img/srcset, iframe, source, video, object, SVG image/use, style attribute, <style> block or stylesheet url()/@import pointing at a host other than hugo.yaml's and next.yaml's baseURL. TestPageLoads covers the scanner. - Branding links each font to its upstream repo and its served license; Contributing's Writing docs covers the fonts and the check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
87 lines
4.8 KiB
HTML
87 lines
4.8 KiB
HTML
{{- /* The page's social card (og-image.html). Hugo's twitter_cards.html writes twitter:card and twitter:image
|
|
from the same card, through _funcs/get-page-images.html. */ -}}
|
|
{{- with partialCached "og-image.html" . .RelPermalink }}
|
|
<meta property="og:image" content="{{ .Image.Permalink }}">
|
|
<meta property="og:image:type" content="image/png">
|
|
<meta property="og:image:width" content="{{ .Image.Width }}">
|
|
<meta property="og:image:height" content="{{ .Image.Height }}">
|
|
<meta property="og:image:alt" content="{{ .Alt }}">
|
|
<meta name="twitter:image:alt" content="{{ .Alt }}">
|
|
{{- end }}
|
|
{{- /* The site's three fonts, served from the site itself, so a page asks no other host for anything
|
|
(internal/cli/docgen's TestNoThirdPartyLoads checks the built site). Each is upstream's file as it is,
|
|
with its OFL as LICENSE beside it; a new version is downloaded from the same place, checked against
|
|
its SHA-256 here, then the sums here are updated.
|
|
- Instrument Sans, variable (wdth 75-100, wght 400-700), roman and italic: Instrument/instrument-sans
|
|
at commit 7fa22308a3d0c94ee2b3cd537a1196b65db34a3e, fonts/webfonts/InstrumentSans[wdth,wght].woff2
|
|
(sha256 aa72922aafcc0dc18f36ec1d805b0212057dabe8b9d5b8b57f67035aea1b826d) and
|
|
InstrumentSans-Italic[wdth,wght].woff2 (e958f71ffb2d576dd6a9499bd9bb336ad060ab48e1920b2444d68919dee29ba5),
|
|
and OFL.txt (9e27a72ed30eb49a08678f6a5d6ed98ec7ba5368f541637ee0683ec9134ef966).
|
|
- Martian Mono, variable (wdth 75-112.5, wght 100-800): evilmartians/mono's release v1.1.0
|
|
(commit 8ffa86c2998677256252336f3662d60997e74b05), martian-mono-1.1.0-variable.zip
|
|
(sha256 b87730975931dc2dbf0129ecf392ccaf8d29f46bc05e995703da4155db510867), its MartianMonoVF.woff2
|
|
(7cdf8e985a4872246d8c2a19333bcc5e8cbcf512746128823f35c1c43aac238a), and the commit's OFL.txt
|
|
(ddafd2c3f37ef1d83ef284ca63e159befd3820850c5e9eded14ca52eee92c256).
|
|
- Departure Mono: rektdeckard/departure-mono's release v1.500, DepartureMono-1.500.zip
|
|
(sha256 bf3e48059aeef4617ec585bdea81dcc3491c576b3e7a472f52faf40e09ee5c3a), its
|
|
DepartureMono-Regular.woff2 (5b4fed1daa90708aa9c6ee1190abca9dc22164a1c1def0020386e46b61038cfb). */ -}}
|
|
{{- $sans := "fonts/instrument-sans/InstrumentSans.woff2" | relURL }}
|
|
{{- $sansItalic := "fonts/instrument-sans/InstrumentSans-Italic.woff2" | relURL }}
|
|
{{- $mono := "fonts/martian-mono/MartianMono.woff2" | relURL }}
|
|
{{- $departure := "fonts/departure-mono/DepartureMono-Regular.woff2" | relURL }}
|
|
<link rel="preload" href="{{ $sans }}" as="font" type="font/woff2" crossorigin>
|
|
<link rel="preload" href="{{ $departure }}" as="font" type="font/woff2" crossorigin>
|
|
<style>
|
|
/* Here, not in custom.css: Hugo moves that file, and relURL keeps these paths right. */
|
|
@font-face {
|
|
font-family: "Instrument Sans";
|
|
src: url("{{ $sans }}") format("woff2");
|
|
font-weight: 400 700;
|
|
font-stretch: 75% 100%;
|
|
font-style: normal;
|
|
font-display: swap;
|
|
}
|
|
@font-face {
|
|
font-family: "Instrument Sans";
|
|
src: url("{{ $sansItalic }}") format("woff2");
|
|
font-weight: 400 700;
|
|
font-stretch: 75% 100%;
|
|
font-style: italic;
|
|
font-display: swap;
|
|
}
|
|
@font-face {
|
|
font-family: "Martian Mono";
|
|
src: url("{{ $mono }}") format("woff2");
|
|
font-weight: 100 800;
|
|
font-stretch: 75% 112.5%;
|
|
font-style: normal;
|
|
font-display: swap;
|
|
}
|
|
@font-face {
|
|
font-family: "Departure Mono";
|
|
src: url("{{ $departure }}") format("woff2");
|
|
font-weight: 400;
|
|
font-style: normal;
|
|
font-display: swap;
|
|
}
|
|
</style>
|
|
{{- /* The sidebar's top-level items get their section's pixel icon, from data/sections.yaml, the list the
|
|
docs' section cards use too, so the two always match. Each icon is a mask in the link's color, keyed
|
|
to the section page's own address. The build fails when the list names a section or an icon that
|
|
doesn't exist. */ -}}
|
|
{{- $selectors := slice -}}
|
|
{{- $rules := slice -}}
|
|
{{- range $path, $name := hugo.Data.sections -}}
|
|
{{- $page := site.GetPage (printf "/docs/%s" $path) -}}
|
|
{{- if not $page }}{{ errorf "data/sections.yaml: no page docs/%s" $path }}{{ end -}}
|
|
{{- $svg := resources.Get (printf "icons/%s.svg" $name) -}}
|
|
{{- if not $svg }}{{ errorf "data/sections.yaml: no assets/icons/%s.svg for %s" $name $path }}{{ end -}}
|
|
{{- $selector := printf `.hextra-sidebar-container a[href=%q] > span::before` $page.RelPermalink -}}
|
|
{{- $selectors = $selectors | append $selector -}}
|
|
{{- $rules = $rules | append (printf `%s { mask-image: url("data:image/svg+xml;base64,%s"); }` $selector ($svg.Content | base64Encode)) -}}
|
|
{{- end }}
|
|
<style>
|
|
{{ printf `%s { content: ""; display: inline-block; flex-shrink: 0; width: 12px; height: 12px; margin-right: 0.5rem; vertical-align: -1px; background-color: currentColor; mask-repeat: no-repeat; mask-position: center; mask-size: 12px 12px; }` (delimit $selectors ", ") | safeCSS }}
|
|
{{ delimit $rules "\n " | safeCSS }}
|
|
</style>
|