From 78e54b375f414c652723723596eb6e397c5a87c6 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sun, 1 Jan 2017 12:45:37 +0100 Subject: [PATCH] Move scripts to own file --- website/_includes/_scripts.jade | 23 +++++++++++++++++++++++ website/_layout.jade | 11 +---------- 2 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 website/_includes/_scripts.jade diff --git a/website/_includes/_scripts.jade b/website/_includes/_scripts.jade new file mode 100644 index 000000000..544cf0977 --- /dev/null +++ b/website/_includes/_scripts.jade @@ -0,0 +1,23 @@ +//- 💫 INCLUDES > SCRIPTS + +script(src="/assets/js/main.js?v#{V_JS}", type="text/javascript") +script(src="/assets/js/prism.js", type="text/javascript") + +if SECTION == "docs" + script. + ((window.gitter = {}).chat = {}).options = { + useStyles: false, + activationElement: '.js-gitter-button', + targetElement: '.js-gitter', + room: '!{SOCIAL.gitter}' + }; + + script(src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer) + +if environment == "deploy" + script + | window.ga=window.ga||function(){ + | (ga.q=ga.q||[]).push(arguments)}; ga.l=+new Date; + | ga('create', '#{ANALYTICS}', 'auto'); ga('send', 'pageview'); + + script(async src="https://www.google-analytics.com/analytics.js") diff --git a/website/_layout.jade b/website/_layout.jade index b04c4b5f3..d5c52df3f 100644 --- a/website/_layout.jade +++ b/website/_layout.jade @@ -52,13 +52,4 @@ html(lang="en") main!=yield include _includes/_footer - script(src="/assets/js/main.js?v#{V_JS}", type="text/javascript") - script(src="/assets/js/prism.js", type="text/javascript") - - if environment == "deploy" - script - | window.ga=window.ga||function(){ - | (ga.q=ga.q||[]).push(arguments)}; ga.l=+new Date; - | ga('create', '#{ANALYTICS}', 'auto'); ga('send', 'pageview'); - - script(async src="https://www.google-analytics.com/analytics.js") + include _includes/_scripts