diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-04 15:30:33 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-04 15:30:33 +0200 |
| commit | 799bd2304a82d35991876d42fc32a8b8be978da1 (patch) | |
| tree | 77373500f6cb733f3bc490dc7fe71db8bc6a7fa8 /layouts/_partials/head/js.html | |
| download | danixxyz-theme-799bd2304a82d35991876d42fc32a8b8be978da1.tar.gz danixxyz-theme-799bd2304a82d35991876d42fc32a8b8be978da1.zip | |
initial theme setup.
Diffstat (limited to 'layouts/_partials/head/js.html')
| -rw-r--r-- | layouts/_partials/head/js.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/layouts/_partials/head/js.html b/layouts/_partials/head/js.html new file mode 100644 index 0000000..0210efa --- /dev/null +++ b/layouts/_partials/head/js.html @@ -0,0 +1,15 @@ +{{- with resources.Get "js/main.js" }} + {{- $opts := dict + "minify" (cond hugo.IsDevelopment false true) + "sourceMap" (cond hugo.IsDevelopment "linked" "none") + }} + {{- 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 }} |
