From 3b5d3d5264bb8116f9788138bbf2494284082bd1 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sat, 30 Jan 2021 14:32:09 +0100 Subject: [PATCH] Optimize font loading --- src/index.pug | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.pug b/src/index.pug index c9b94da..d13a52a 100644 --- a/src/index.pug +++ b/src/index.pug @@ -23,7 +23,12 @@ html(lang="en") title toot link(rel="stylesheet", href="main.css") - link(rel="stylesheet", href="https://fonts.googleapis.com/css2?family=Montserrat:wght@600&family=Roboto:wght@400;500&display=swap") + link(rel="preconnect", href="https://fonts.gstatic.com" crossorigin) + + link(href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="preload" as="style") + link(href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet" media="print" onload="this.media='all'") + noscript + link(href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet") link(rel='icon' href='/favicon.ico') link(rel='icon' type='image/svg+xml' href='/apple-touch-icon.png')