diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 8766abc..829e96b 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -32,15 +32,20 @@ {{- $customCss := resources.Get "css/custom.css" -}} {{- $variablesCss := resources.Get "css/variables.css" | resources.ExecuteAsTemplate "css/variables.css" . -}} - {{- if hugo.IsProduction }} - {{- $styles := slice $variablesCss $mainCss $customCss | resources.Concat "css/compiled/main.css" | minify | fingerprint }} - - + {{- if and (not hugo.IsProduction) (eq hugo.Environment "theme") }} + {{- $devStyles := resources.Get "css/styles.css" | postCSS (dict "inlineImports" true) }} + {{- else }} - {{- $styles := resources.Get "css/styles.css" | postCSS (dict "inlineImports" true) }} - - - + {{- if hugo.IsProduction }} + {{- $styles := slice $variablesCss $mainCss $customCss | resources.Concat "css/compiled/main.css" | minify | fingerprint }} + + + {{- else }} + {{- $styles := resources.Get "css/compiled/main.css" -}} + + + + {{- end }} {{- end }} @@ -77,11 +82,11 @@ {{ $noop := .WordCount -}} {{ if .Page.Store.Get "hasMath" -}} - {{ $katexBaseUrl := "https://cdn.jsdelivr.net/npm/katex@latest/dist" }} + {{ $katexBaseUrl := "https://cdn.jsdelivr.net/npm/katex@latest/dist" }} {{ $katexCssUrl := printf "%s/katex%s.css" $katexBaseUrl (cond hugo.IsProduction ".min" "") -}} {{ $katexFontPattern := "url(fonts/" }} {{ $katexFontSubstituted := printf "url(%s/fonts/" $katexBaseUrl }} - + {{ with try (resources.GetRemote $katexCssUrl) -}} {{ with .Err -}} {{ errorf "Could not retrieve KaTeX css file from %s. Reason: %s." $katexCssUrl . -}}