From 47d23b3afdaad1288951627a4f62ebdf09e3118a Mon Sep 17 00:00:00 2001 From: Francesco Date: Wed, 24 Apr 2024 14:53:00 +0200 Subject: [PATCH] Removed unnecessary math.js load --- README.md | 1 + layouts/_default/baseof.html | 6 +----- layouts/partials/head.html | 3 +++ layouts/partials/head/js.html | 14 ++++---------- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 080539d..5cf3887 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ summary: "A search engine overview and Rust implementation." toc: true readTime: true autonumber: true +math: true --- Your content... diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 524af7f..e5ac09e 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -4,9 +4,6 @@ {{ partial "head.html" . }} - {{ if .Param "math" }} - {{ partialCached "math.html" . }} - {{ end }} {{ $theme := "auto"}} @@ -28,7 +25,7 @@ @@ -71,7 +68,6 @@ setTheme(); - diff --git a/layouts/partials/head.html b/layouts/partials/head.html index a16d7ea..962ebf4 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -4,6 +4,9 @@ {{ partialCached "head/css.html" . }} {{ partialCached "head/js.html" . }} +{{ if .Param "math" }} +{{ partialCached "math.html" . }} +{{ end }} {{ if hugo.IsProduction }} {{ template "_internal/google_analytics.html" . }} diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html index 18fe842..8bae509 100644 --- a/layouts/partials/head/js.html +++ b/layouts/partials/head/js.html @@ -1,12 +1,6 @@ {{- with resources.Get "js/main.js" }} - {{- if eq hugo.Environment "development" }} - {{- with . | js.Build }} - - {{- end }} - {{- else }} - {{- $opts := dict "minify" true }} - {{- with . | js.Build $opts | fingerprint }} - - {{- end }} - {{- end }} +{{- $opts := dict "minify" true }} +{{- with . | js.Build $opts | fingerprint }} + {{- end }} +{{- end }} \ No newline at end of file