docs: only serve disqus and google analytics when in production env

This commit is contained in:
Brian Mann
2017-06-20 10:12:42 -04:00
parent e27c5883a3
commit 22eee9bfa6
3 changed files with 3 additions and 7 deletions

View File

@@ -3,11 +3,7 @@
{{ partial('partial/head') }}
<body>
<script type="text/javascript">
if (window.Cypress) {
window.env = 'test'
} else {
window.env = '{{env.NODE_ENV}}'
}
window.env = window.Cypress ? 'test' : '{{env.NODE_ENV}}'
</script>
{{ partial('partial/google-tag-manager-noscript')}}
<div id="container">

View File

@@ -3,7 +3,7 @@
<div id="disqus_thread"></div>
</section>
<script type="text/javascript">
if (window.env !== 'test') {
if (window.env === 'production') {
var disqus_shortname = '{{ config.disqus_shortname }}';
var disqus_url = '{{ url }}';
var disqus_title = {{ JSON.stringify(page.title) }};

View File

@@ -1,6 +1,6 @@
{% if config.google %}
<script type="text/javascript">
if (window.env !== 'test') {
if (window.env === 'production') {
// Google Optimize: This snippet ensures that users only
// see your variant content, minimizing page flicker.
(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date;