From 898040b8dd3257783292b9542ce863944e6cc6ea Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Thu, 23 Feb 2023 17:46:00 +0100 Subject: preload webfonts --- html/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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"; -- cgit v1.2.3