mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-17 20:51:24 -06:00
docs: only serve disqus and google analytics when in production env
This commit is contained in:
6
docs/themes/cypress/layout/layout.swig
vendored
6
docs/themes/cypress/layout/layout.swig
vendored
@@ -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">
|
||||
|
||||
@@ -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) }};
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user