fix(@embark/site): ensure fathom script is only loaded in production environment

This commit is contained in:
Pascal Precht 2019-11-14 16:29:12 +01:00 committed by Michael Bradley
parent 92c5062e3e
commit 7c5d662772
2 changed files with 3 additions and 1 deletions

View File

@ -30,7 +30,7 @@ function main() {
}
console.log('Deploying website...');
process.chdir(SITE_DIR);
execWithOutput('npx hexo generate');
execWithOutput('npx hexo generate --production');
try {
execWithOutput('git branch -D embark-site-deploy');
} catch (e) {

View File

@ -13,6 +13,7 @@
};
</script>
{% if env.args.production %}
<!-- Fathom - simple website analytics - https://github.com/usefathom/fathom -->
<script>
(function(f, a, t, h, o, m){
@ -26,6 +27,7 @@
fathom('trackPageview');
</script>
<!-- / Fathom -->
{% endif %}
<script src="/js/index.js"></script>