I inline CSS in the head of my template like this:
<style>
{{ partial "css-default.html" . }}
</style>
This triggers the ZgotmplZ
value in the HTML code, caused by unsafe CSS content reached (docs). But how can we apply safeCSS
to a partial?
This generates an error:
{{ partial "css-default-trascr.html" . | safeCSS }}
executing "theme/partials/head.html" at <safeCSS>: wrong typ
e for value; expected string; got template.HTML in theme/partials/head.html
This also generates an error:
{{ partial "css-default-trascr.html" | safeCSS . }}
executing "theme/partials/head.html" at <safeCSS>: wrong num
ber of args for safeCSS: want 1 got 1 in theme/partials/head.html
(Off-topic: perhaps this latter message can be improved: want 1 got 1
sound odd, doesn’t it? )