@adcgn the little know chomp
will take you there! Write it like this for correct CDATA-output:
<content:encoded>{{chomp "<![CDATA[\n"}}{{ .Content | safeHTML }}{{chomp "]]>\n"}}</content:encoded>
You will get an error viewing it directly in the browser, but the source is correctly formatted.