From 8aba612a0013e84f0b3f9d60863c02ad1b0bfd6e Mon Sep 17 00:00:00 2001 From: Aiden Bai Date: Fri, 27 May 2022 18:42:01 -0700 Subject: [PATCH] Fix non-spa fallback --- layouts/partials/head.html | 58 +++++++++++++++----------------------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index b65bb8430..2da259d46 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -5,45 +5,31 @@ name="description" content="{{if .IsHome}}{{$.Site.Data.config.description}}{{else}}{{.Summary}}{{end}}" /> - - {{ if .Title }}{{ .Title }}{{ else }}{{ $.Site.Data.config.page_title }}{{ - end }} - + {{ if .Title }}{{ .Title }}{{ else }}{{ $.Site.Data.config.page_title }}{{ end }} - + - {{$sass := resources.Match "styles/[!_]*.scss" }} - {{$css := slice }} - {{range $sass}} - {{$scss := . | resources.ToCSS (dict "outputStyle" "compressed") }} - {{$css = $css | append $scss}} - {{end}} - {{$finalCss := $css | resources.Concat "styles.css" | resources.Fingerprint "md5" | resources.Minify }} + {{$sass := resources.Match "styles/[!_]*.scss" }} {{$css := slice }} {{range $sass}} {{$scss := . + | resources.ToCSS (dict "outputStyle" "compressed") }} {{$css = $css | append $scss}} {{end}} + {{$finalCss := $css | resources.Concat "styles.css" | resources.Fingerprint "md5" | + resources.Minify }} - {{ $darkMode := resources.Get "js/darkmode.js" | resources.Fingerprint "md5" | - resources.Minify }} + {{ $darkMode := resources.Get "js/darkmode.js" | resources.Fingerprint "md5" | resources.Minify }} - {{partial "katex.html" .}} - - {{ $popover := resources.Get "js/popover.js" | resources.Fingerprint "md5" | - resources.Minify }} + {{partial "katex.html" .}} {{ $popover := resources.Get "js/popover.js" | resources.Fingerprint + "md5" | resources.Minify }} - {{$linkIndex := resources.Get "indices/linkIndex.json" | resources.Fingerprint - "md5" | resources.Minify | }} {{$contentIndex := resources.Get - "indices/contentIndex.json" | resources.Fingerprint "md5" | resources.Minify - }} + {{$linkIndex := resources.Get "indices/linkIndex.json" | resources.Fingerprint "md5" | + resources.Minify | }} {{$contentIndex := resources.Get "indices/contentIndex.json" | + resources.Fingerprint "md5" | resources.Minify }} - {{if $.Site.Data.config.enableSPA}} - {{ $router := resources.Get "js/router.js" | resources.Fingerprint "md5" | - resources.Minify }} + {{if $.Site.Data.config.enableSPA}} {{ $router := resources.Get "js/router.js" | + resources.Fingerprint "md5" | resources.Minify }} {{else}} {{end}}