diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2023-02-23 17:46:00 +0100 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2023-02-23 17:46:00 +0100 |
| commit | 898040b8dd3257783292b9542ce863944e6cc6ea (patch) | |
| tree | 509f6610170371b6cc6ed9de490a20c91d7cf98c /html | |
| parent | 00a01a841334d65a6be21ed7f36626ec109918d3 (diff) | |
preload webfonts
Diffstat (limited to 'html')
| -rw-r--r-- | html/default.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/html/default.nix b/html/default.nix index b001d91..b68ad07 100644 --- a/html/default.nix +++ b/html/default.nix @@ -1,6 +1,13 @@ { html, make, ... }: -let sections = html.sort.byKey "priority" (make ./sections.nix { }); +let + sections = html.sort.byKey "priority" (make ./sections.nix { }); + preloadFont = href: + html.linkWith { + inherit href; + rel = "preload"; + as = "font"; + }; in with html; html.html { lang = "en"; } [ (head [ @@ -29,6 +36,8 @@ html.html { lang = "en"; } [ rel = "stylesheet"; href = "/static/css/fonts/line-awesome/line-awesome.min.css"; }) + (preloadFont "/static/css/fonts/line-awesome/webfonts/la-solid-900.woff2") + (preloadFont "/static/css/fonts/line-awesome/webfonts/la-brands-400.woff2") # CSS (linkWith { rel = "stylesheet"; |
