I am building a site with Hakyll and I only want my Google Analytics code to be included if I am deploying the site, not when I’m just testing it using “site server”. Ideally I’d be able to write something like
$if(deploying)$
<script src=".../whatever.js"></script>
$endif$
in a template and have that content included when I run “site build” but not “site server”. Does Hakyll have any built-in way to determine which subcommand is being run? Or can I somehow access the process’s environment variables?