OK, so my fix in d1c3944 fixed the most serious issue, but now Goat diagrams doesn't render in the Hugo docs site, which I guess comes from that site having a default codeblock template.
But that needs to wait for another day.
Edit in: This is the case where we prefer user provided template if possible; this makes a user provided render-codeblock.html win over the embedded render-codeblock-goat.html.