]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
create/skeletons: Use css.Build in theme skeleton
authorJoe Mooring <joe.mooring@veriphor.com>
Sun, 15 Mar 2026 13:42:17 +0000 (06:42 -0700)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 15 Mar 2026 15:51:24 +0000 (16:51 +0100)
Closes #14626

create/skeletons/theme/assets/css/components/footer.css [new file with mode: 0644]
create/skeletons/theme/assets/css/components/header.css [new file with mode: 0644]
create/skeletons/theme/assets/css/main.css
create/skeletons/theme/layouts/_partials/head/css.html
create/skeletons/theme/layouts/_partials/head/js.html

diff --git a/create/skeletons/theme/assets/css/components/footer.css b/create/skeletons/theme/assets/css/components/footer.css
new file mode 100644 (file)
index 0000000..abe2b5a
--- /dev/null
@@ -0,0 +1,4 @@
+footer {
+  border-top: 1px solid #222;
+  margin-top: 1rem;
+}
diff --git a/create/skeletons/theme/assets/css/components/header.css b/create/skeletons/theme/assets/css/components/header.css
new file mode 100644 (file)
index 0000000..8efea1e
--- /dev/null
@@ -0,0 +1,4 @@
+header {
+  border-bottom: 1px solid #222;
+  margin-bottom: 1rem;
+}
index 166ade9245232d7735f4f92a1a5d78bfce45ddd2..6c0b66090683f496420f79ee2e8cabe7e9101134 100644 (file)
@@ -1,3 +1,6 @@
+@import "components/header.css";
+@import "components/footer.css";
+
 body {
   color: #222;
   font-family: sans-serif;
@@ -6,16 +9,6 @@ body {
   max-width: 768px;
 }
 
-header {
-  border-bottom: 1px solid #222;
-  margin-bottom: 1rem;
-}
-
-footer {
-  border-top: 1px solid #222;
-  margin-top: 1rem;
-}
-
 a {
   color: #00e;
   text-decoration: none;
index d76d23a16cec3ffb32230569bd97713194f1700f..889786684b135047e67ad224236dd49b68279aa0 100644 (file)
@@ -1,9 +1,15 @@
 {{- with resources.Get "css/main.css" }}
-  {{- if hugo.IsDevelopment }}
-    <link rel="stylesheet" href="{{ .RelPermalink }}">
-  {{- else }}
-    {{- with . | minify | fingerprint }}
-      <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
+  {{- $opts := dict
+    "minify" (cond hugo.IsDevelopment false true)
+    "sourceMap" (cond hugo.IsDevelopment "linked" "none")
+  }}
+  {{- with . | css.Build $opts }}
+    {{- if hugo.IsDevelopment }}
+      <link rel="stylesheet" href="{{ .RelPermalink }}">
+    {{- else }}
+      {{- with . | fingerprint }}
+        <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
+      {{- end }}
     {{- end }}
   {{- end }}
 {{- end }}
index 16ffbedfeaa75ab67400e913c68f920a893d49b9..0210efa8b427dd3538a8fd4e41ba2fda08cc8132 100644 (file)
@@ -1,8 +1,7 @@
 {{- with resources.Get "js/main.js" }}
   {{- $opts := dict
-    "minify" (not hugo.IsDevelopment)
-    "sourceMap" (cond hugo.IsDevelopment "external" "")
-    "targetPath" "js/main.js"
+    "minify" (cond hugo.IsDevelopment false true)
+    "sourceMap" (cond hugo.IsDevelopment "linked" "none")
   }}
   {{- with . | js.Build $opts }}
     {{- if hugo.IsDevelopment }}