From 07facf5828ab3f9ab373405e849f8e293fd5d7c2 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Mon, 31 Aug 2020 17:36:30 +0100 Subject: [PATCH] perf: pre-connect to Google Fonts if using Google Fonts Increase performance. --- layouts/partials/site_footer.html | 2 +- layouts/partials/site_head.html | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/layouts/partials/site_footer.html b/layouts/partials/site_footer.html index c9ce0131..22b9bcc9 100644 --- a/layouts/partials/site_footer.html +++ b/layouts/partials/site_footer.html @@ -21,7 +21,7 @@

{{ if not site.Params.i_am_a_sponsor }} Published with - Academic Website Builder + Wowchemy Website Builder {{ end }} {{ if not (in (slice "book" "docs" "updates") .Type) }} diff --git a/layouts/partials/site_head.html b/layouts/partials/site_head.html index aa3cf334..3f08fe29 100644 --- a/layouts/partials/site_head.html +++ b/layouts/partials/site_head.html @@ -44,6 +44,12 @@ {{ partial "functions/parse_theme" . }} + + {{/* Pre-connect to Google Fonts if the site's Font Theme uses them. */}} + {{ with ($scr.Get "google_fonts") }} + + {{end}} + {{ $css := site.Data.assets.css }} {{ $js := site.Data.assets.js }} {{ if ne ($scr.Get "primary") "#fff" }}