Closed pjincz closed 9 years ago
You could try writing
script.
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
#[= ab ? "ga('set', 'expId', '" + ab.id + "');" : ""]
#[= ab ? "ga('set', 'expVar', '" + ab.varid + "');" : ""]
ga('send', 'pageview');
Tagless dot has been implemented so you can do this in jade 2.0.0:
script
.
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
if ab
.
ga('set', 'expId', '#{ab.id}');
ga('set', 'expVar', '#{ab.varid}');
.
ga('send', 'pageview');
You can also use piped text:
script
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
| })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
if ab
| ga('set', 'expId', '#{ab.id}');
| ga('set', 'expVar', '#{ab.varid}');
| ga('send', 'pageview');
Hi friend,
Can you support pure plain text block, such as follow
I known I can write
tag.
begin a text block. But I cannot do more control in the text block. And some times, we have to generate codes by some condition.Thank you for your awesome project. Best regards