Hugo asset pipes work on files under assets/ (not static/).
CSS
{{ $css := resources.Get "css/style.css" }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
resources.Get is rooted at assets/. Writing .RelPermalink copies the processed file into public/.
Minify and fingerprint
{{ $css := resources.Get "css/style.css" | minify | fingerprint }}
You get a name like /css/style.min.<hash>.css that changes when the content changes (cache busting).
Sass
{{ $css := resources.Get "css/style.scss" | toCSS | minify | fingerprint }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
Split styles into _partial.scss and @import them into the main file.
For Tailwind-specific setup, see Tailwind with Hugo .
JavaScript
{{ $script := resources.Get "js/script.js" }}
{{ $script2 := resources.Get "js/script2.js" }}
{{ $libs := slice $script $script2 }}
{{ $js := $libs | resources.Concat "js/app.js" | minify | fingerprint }}
<script src="{{ $js.RelPermalink }}"></script>
resources.Concat merges a slice of resources into one output file.
Andrew Dorokhov