From 8aba612a0013e84f0b3f9d60863c02ad1b0bfd6e Mon Sep 17 00:00:00 2001 From: Aiden Bai Date: Fri, 27 May 2022 18:42:01 -0700 Subject: [PATCH 1/2] 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 b65bb84..2da259d 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}} From 006b74ec6feed2d01099754c888bac4a9474a6b1 Mon Sep 17 00:00:00 2001 From: Aiden Bai Date: Fri, 27 May 2022 18:45:42 -0700 Subject: [PATCH 2/2] Fix formatting --- layouts/partials/head.html | 40 +++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 2da259d..25120d5 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -5,31 +5,44 @@ 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 }} - {{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 }}