I’ve got a block of code to support a Google Custom Engine. It is saved in search.md and looks like so:
+++
title = "Search"
+++
<script>
(function() {
var cx = '013262903309526573707:i2otogiya2g';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search queryParameterName="q"></gcse:search>
However, when rendere by Hugo, I get errors because the string in the var cx
line is modified. I know there is a safeJS function I can pass stuff to - but how do I tell Hugo to not modify this at all.