{{- /* custom-js.html (partial): Allows users to load custom JavaScript before the ``. Features: - Conditionally load the `custom-head.js` file if non-JSDoc content is detected. - Minifies and fingerprints the file in production for optimal performance. Dependencies: - `assets/js/custom-tail.js` Repo: https://github.com/oxypteros/alpha */ -}} {{- with resources.Get "js/custom-tail.js" }} {{- $content := .Content | strings.TrimSpace -}} {{- /* Remove all comment blocks */}} {{- $content := replaceRE `(?s)/\*\*\*.*?\*/` "" $content | strings.TrimSpace -}} {{- if $content -}} {{- if eq hugo.Environment "development" -}} {{- with . | js.Build }} {{- end }} {{- else }} {{- $opts := dict "minify" true }} {{- with . | js.Build $opts | fingerprint }} {{- end }} {{- end }} {{- end }} {{- end }}