I’m building my own disqus partial (I’ve got some weird requirements for my site so I can’t use the built in support) and am running into issues trying to build a URL string. This is what I have:
Strange as it sounds, try removing the quotes around the string. You should see in the rendered page the .URL value replaced with the URL, quoted. The Go template parser is context-aware, and so auto-quotes text inside JavaScript blocks. It took me a few attempts playing with the syntax to get what I wanted, but I wouldn’t have ever thought to remove the quotes had I not seen this comment.
I’ve found Go templates are very picky about context. You generally need to output the entire string, not part of it. Try something like this in a script context:
var raymond = {{ printf "http://www.raymondcamden.com%s" .URL | safeJS }}