0

I've been trying for the past hour to build my jekyll site locally with JEKYLL_ENV=production with no success. I've tried the following methods which I got from this.

  1. set JEKYLL_ENV=production | jekyll build
  2. run one command at a time a. set JEKYLL_ENV=production b. jekyll build
  3. edit _config.yml and add a line environment: production
  4. Manually add a new JEKYLL_ENV environment variable with value production on my Windows 11

What am I missing? Any suggestions on how I can troubleshoot?

My new site is based off the Chirpy theme, created using the Chirpy Starter

I also noticed that my deployed site is also in development mode. I'm using the GitHub Actions automatically generated by Azure Static Web Apps using this tutorial. This is even when I added the line environment: production to _config.yml

Thanks in advance!

Rafferty
  • 937
  • 1
  • 9
  • 16
  • Have you tried `jekyll JEKYLL_ENV=production build`? – juicy-g Mar 06 '22 at 16:50
  • @juicy-g just tried, and got this error `fatal: 'jekyll JEKYLL_ENV=production' could not be found. You may need to install the jekyll-JEKYLL_ENV=production gem or a related gem to be able to use this subcommand. ` – Rafferty Mar 07 '22 at 00:43
  • Ok my comment above is not correct. It should be `jekyll build JEKYLL_ENV=production`. Are you using WSL or just plain command prompt on Windows? – juicy-g Mar 07 '22 at 13:02
  • @juicy-g thanks for helping me troubleshoot. It's still not working. I tried adding some random HTML in my footer with `{% if jekyll.environment == 'production' %} {% endif %}` and it doesn't enter this branch. I'm using plain windows command prompt, hoping I don't need WSL for this? – Rafferty Mar 09 '22 at 11:49

0 Answers0