From 94a11b8b15766f38c18c469b4078c53228b476b6 Mon Sep 17 00:00:00 2001 From: Rabin Adhikari Date: Mon, 14 Dec 2020 22:10:48 +0545 Subject: [PATCH] Defer non-critical resources and use more sensible CDN provider (#489) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Defer non-critical resources and use more sensible CDN provider * Seems like defer doesn't work for css * Delete vscode related files * Remove comments from as per code review Co-authored-by: Luiz F. A. de Prá Co-authored-by: Luiz F. A. de Prá --- layouts/_default/baseof.html | 9 ++++++--- layouts/partials/posts/math.html | 17 ++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 4dfc119..1603d5f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -19,9 +19,11 @@ {{ end }} + - - + + {{ if .Site.IsServer }} {{ $cssOpts := (dict "targetPath" "css/coder.css" "enableSourceMap" true ) }} {{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts }} @@ -83,7 +85,8 @@ {{ end -}} {{ if .Site.Params.enableTwemoji }} - + {{ end }} {{ hugo.Generator }} diff --git a/layouts/partials/posts/math.html b/layouts/partials/posts/math.html index 35b779f..56245ac 100644 --- a/layouts/partials/posts/math.html +++ b/layouts/partials/posts/math.html @@ -1,7 +1,7 @@ {{- if or (.Params.math) (.Site.Params.math) -}} - - + {{/* The file is already minified */}} + {{- end -}} {{- if or (.Params.katex) (.Site.Params.katex) -}} - - - + + );"> {{- end -}}