diff options
| author | Roberto Esteves <contact@robertoesteves.dev> | 2025-12-31 14:19:13 +0000 |
|---|---|---|
| committer | Roberto Esteves <contact@robertoesteves.dev> | 2025-12-31 14:19:13 +0000 |
| commit | 78070157c5ecee8ef52fe25f74e28fe188cfa95c (patch) | |
| tree | bca4c635dd86d017e053f64ac75938858eeb7111 /themes/robson/layouts/_partials/head | |
Diffstat (limited to 'themes/robson/layouts/_partials/head')
| -rw-r--r-- | themes/robson/layouts/_partials/head/css.html | 12 | ||||
| -rw-r--r-- | themes/robson/layouts/_partials/head/js.html | 16 |
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 }} |