{{ with resources.Get “/scss/main/home.scss” | toCSS | minify }}
{{ .Content | safeCSS }}
{{ end }}
This also works fine though why the need for the if-file-exists? Without it I get “error calling toCSS: type not supported in Resource transformations”.
{{ if (fileExists ( printf “assets/%s” $scss )) }}
{{ with resources.Get $scss | toCSS | minify}}
{{ .Content }}
{{end}}
{{ end }}
If I add the style tags it gives an error over context:
{{ if (fileExists ( printf “assets/%s” $scss )) }}
{{ with resources.Get $scss | toCSS | minify}}
{{ .Content }}
{{end}}
{{ end }}
{{with}} branches end in different contexts: {stateCSS delimNone urlPartNone jsCtxRegexp attrNone elementStyle }, {stateText delimNone urlPartNone jsCtxRegexp attrNone elementNone }
due to the tags that give me ```
{{with}} branches end in different contexts: {stateText delimNone urlPartNone jsCtxRegexp attrNone elementNone }, {stateCSS delimNone urlPartNone jsCtxRegexp attrNone elementStyle }