about summary refs log tree commit diff
path: root/pkgs/profpatsch/profpatsch.de/index.html.nix
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2020-07-18 19:05:06 +0200
committerProfpatsch <mail@profpatsch.de>2020-07-18 19:22:15 +0200
commit7df7065ab33da35109d089f23c506d64f41e9448 (patch)
tree04f7a3011ebdc61070918446e579772fe6f7a80f /pkgs/profpatsch/profpatsch.de/index.html.nix
parent345be56b649a86ecab577b06c921a24bcdef32b4 (diff)
pkgs/profpatsch.de: add preloading directives
Those tell the browser that it’s going to need them later, even it
hasn’t found them yet (e.g. the fonts can only be found after loading
the CSS).
Diffstat (limited to 'pkgs/profpatsch/profpatsch.de/index.html.nix')
-rw-r--r--pkgs/profpatsch/profpatsch.de/index.html.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkgs/profpatsch/profpatsch.de/index.html.nix b/pkgs/profpatsch/profpatsch.de/index.html.nix
index 141570ad..607d5d0c 100644
--- a/pkgs/profpatsch/profpatsch.de/index.html.nix
+++ b/pkgs/profpatsch/profpatsch.de/index.html.nix
@@ -1,6 +1,8 @@
 { jsJquery
 , cssNormalize, cssMain
-, id_txt, cv_pdf }:
+, id_txt, cv_pdf
+, fontsQuattrocentoLatin, fontsOpenSansLatin
+}:
 ''
 <!DOCTYPE html>
 <html>
@@ -11,9 +13,17 @@
     <meta name="description" content="Oh the things you’ll see …">
     <meta name="viewport" content="width=device-width, initial-scale=1">
 
+    <link rel="preload" href="${jsJquery}" as="script">
+    <link rel="preload" href="${cssNormalize}" as="style">
+    <link rel="preload" href="${cssMain}" as="style">
+    <!-- TODO: the font type is a magic string here -->
+    <link rel="preload" href="${fontsQuattrocentoLatin}" as="font" type="font/woff2" crossorigin>
+    <link rel="preload" href="${fontsOpenSansLatin}" as="font" type="font/woff2" crossorigin>
+
     <link rel="stylesheet" href="${cssNormalize}">
     <link rel="stylesheet" href="${cssMain}">
 
+    <!-- TODO: get rid of jquery -->
     <script src="${jsJquery}"></script>
   </head>
   <body>