aboutsummaryrefslogtreecommitdiff
path: root/www/layouts/partials/js.html
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-02-24 02:18:20 +0800
committerYuqian Yang <crupest@crupest.life>2025-02-26 02:21:41 +0800
commit0c885ba1bf30ce8308880f926be85b6f5a499fa6 (patch)
tree25f42a9386f760c9d7d47d9b154e4a0089e49dff /www/layouts/partials/js.html
parentdc7b27c713351066e20947ea6d1adb80aeb68d9f (diff)
downloadcrupest-0c885ba1bf30ce8308880f926be85b6f5a499fa6.tar.gz
crupest-0c885ba1bf30ce8308880f926be85b6f5a499fa6.tar.bz2
crupest-0c885ba1bf30ce8308880f926be85b6f5a499fa6.zip
feat(www): YEAH!
Diffstat (limited to 'www/layouts/partials/js.html')
-rw-r--r--www/layouts/partials/js.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/www/layouts/partials/js.html b/www/layouts/partials/js.html
new file mode 100644
index 0000000..a4e8048
--- /dev/null
+++ b/www/layouts/partials/js.html
@@ -0,0 +1,9 @@
+{{ with resources.Get . }}
+ {{ if hugo.IsProduction }}
+ {{ with . | js.Build (dict "minify" true "sourceMap" "external") | fingerprint }}
+ <script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}"></script>
+ {{ end }}
+ {{ else }}
+ <script src="{{ (. | js.Build dict) .RelPermalink }}"></script>
+ {{ end }}
+{{ end }}