From 5a6fa55d0a44bc3c4ef1a20036f367d7156ce7f3 Mon Sep 17 00:00:00 2001
From: Xin <5097752+imfing@users.noreply.github.com>
Date: Sat, 31 May 2025 19:58:09 +0100
Subject: [PATCH] fix: missing variables and custom styles css imports for
theme dev
---
layouts/partials/head.html | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 829e96b..a8fca97 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -32,20 +32,25 @@
{{- $customCss := resources.Get "css/custom.css" -}}
{{- $variablesCss := resources.Get "css/variables.css" | resources.ExecuteAsTemplate "css/variables.css" . -}}
- {{- if and (not hugo.IsProduction) (eq hugo.Environment "theme") }}
+ {{- /* Production build */ -}}
+ {{- if hugo.IsProduction }}
+ {{- $styles := slice $variablesCss $mainCss $customCss | resources.Concat "css/compiled/main.css" | minify | fingerprint }}
+
+
+
+ {{- /* Theme development mode (non-production + theme environment) */ -}}
+ {{- else if eq hugo.Environment "theme" }}
{{- $devStyles := resources.Get "css/styles.css" | postCSS (dict "inlineImports" true) }}
+
+
+
+ {{- /* User local development */ -}}
{{- else }}
- {{- 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 }}
+ {{- $styles := resources.Get "css/compiled/main.css" -}}
+
+
+
{{- end }}