{{- /* Emit an HTML script element referring to a JavaScript resource. The resource can be either a path or a Hugo Resource object. If the former, the resource will be looked up and built. @context {string|Resource} resource The Resource @context {bool} isModule If true, add information to the script element indicating it should be loaded as a module */ -}} {{- $resource := .resource -}} {{- $isModule := .module -}} {{ if $resource.resource }} {{ $resource = partial "resource_builders/build_js.html" $resource }} {{ end }} {{ with $resource }} {{ if eq hugo.Environment "development" }} {{ else }} {{ end }} {{ end }}