summaryrefslogtreecommitdiff
path: root/themes/robson/layouts/_partials/head
diff options
context:
space:
mode:
authorRoberto Esteves <contact@robertoesteves.dev>2025-12-31 14:19:13 +0000
committerRoberto Esteves <contact@robertoesteves.dev>2025-12-31 14:19:13 +0000
commit78070157c5ecee8ef52fe25f74e28fe188cfa95c (patch)
treebca4c635dd86d017e053f64ac75938858eeb7111 /themes/robson/layouts/_partials/head
init: basic websiteHEADmaster
Diffstat (limited to 'themes/robson/layouts/_partials/head')
-rw-r--r--themes/robson/layouts/_partials/head/css.html12
-rw-r--r--themes/robson/layouts/_partials/head/js.html16
2 files changed, 28 insertions, 0 deletions
diff --git a/themes/robson/layouts/_partials/head/css.html b/themes/robson/layouts/_partials/head/css.html
new file mode 100644
index 0000000..add502d
--- /dev/null
+++ b/themes/robson/layouts/_partials/head/css.html
@@ -0,0 +1,12 @@
+{{ $cssFiles := slice "css/main.css" "css/colorscheme.css" }}
+{{ range $cssFiles }}
+ {{- with resources.Get . }}
+ {{- if hugo.IsDevelopment }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}">
+ {{- else }}
+ {{- with . | minify | fingerprint }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
+ {{- end }}
+ {{- end }}
+ {{- end }}
+{{ end }}
diff --git a/themes/robson/layouts/_partials/head/js.html b/themes/robson/layouts/_partials/head/js.html
new file mode 100644
index 0000000..16ffbed
--- /dev/null
+++ b/themes/robson/layouts/_partials/head/js.html
@@ -0,0 +1,16 @@
+{{- with resources.Get "js/main.js" }}
+ {{- $opts := dict
+ "minify" (not hugo.IsDevelopment)
+ "sourceMap" (cond hugo.IsDevelopment "external" "")
+ "targetPath" "js/main.js"
+ }}
+ {{- with . | js.Build $opts }}
+ {{- if hugo.IsDevelopment }}
+ <script src="{{ .RelPermalink }}"></script>
+ {{- else }}
+ {{- with . | fingerprint }}
+ <script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
+ {{- end }}
+ {{- end }}
+ {{- end }}
+{{- end }}