{{ $targetFilename := "file" }} {{ if eq .type "css" }} {{ $targetFilename = "css/style.css"}} {{ else if eq .type "js" }} {{ $targetFilename = "js/script.js"}} {{ end }} {{ $resource := resources.Get .filename }} {{ if $resource }} {{ $resource := $resource | resources.ExecuteAsTemplate $targetFilename . }} {{ if hugo.IsProduction }} {{ $resource = $resource | resources.Minify }} {{ end }} {{ $resource = $resource | resources.Fingerprint "sha256" }} {{ if eq .type "css" }} {{ else if eq .type "js" }} {{ end }} {{ else }} {{ if eq .type "css" }} {{ else if eq .type "js" }} {{ end }} {{ end }}