Is it possible to set the jekyll.environment variable when s3_website is building the site via s3_website push?
I've tried running JEKYLL_ENV=production s3_website push as well as setting JEKYLL_ENV=production in my .env file (which is otherwise working) but jekyll.environment still equals development when I check it in my templates.
I need it to add Google Analytics in my index.html:
{% if jekyll.environment == 'production' and site.google_analytics %}
{% include google-analytics.html %}
{% endif %}
I guess you first need to run JEKYLL_ENV=production jekyll build
and then s3_website push will do the job of publishing production version of your site.
Is it possible to set the
jekyll.environment
variable when s3_website is building the site vias3_website push
?I've tried running
JEKYLL_ENV=production s3_website push
as well as settingJEKYLL_ENV=production
in my.env
file (which is otherwise working) butjekyll.environment
still equalsdevelopment
when I check it in my templates.I need it to add Google Analytics in my
index.html
: