Unable to set Jekyll Environment to production on Windows 10 - jekyll

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.
set JEKYLL_ENV=production | jekyll build
run one command at a time
a. set JEKYLL_ENV=production
b. jekyll build
edit _config.yml and add a line environment: production
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!

Related

Can a Jekyll plugin / generator be disabled for non-production environment?

I have an custom generator written for creating archive pages (per year, month and day) for my Jekyll blog. But that generator takes some time, can I disable a generator for non-production environment or maybe from the plugins entry in the config?
UPDATE: The plugin is just placed in the _pluginsfolder, it is not delivered / distributed as gem package!
I am looking for a kind of blacklisting of generators (and maybe also filters or other plugins) for development environment to save building time.
Local Plugins
For switching local plugins, you could use two different folders, and switch between them with a combination of multiple config files overwriting your plugins_dir.
You would set the a different value for plugins_dir field in the _config-dev.yml file which would overwrite your value in _config.yml (or the default _plugins if unset):
$ bundle exec jekyll build --config _config.yml,_config-dev.yml
This way you can have two folders with your development and production plugins separate. This has a maintenance cost when you use a plugin across both environments.
Gemfile Plugins
For switching gem-based plugins, you could use a different Gemfile for development without the production plugins:
BUNDLE_GEMFILE=Gemfile-dev bundle exec jekyll build
This gives you a lot of flexibility at the cost of maintaining two files. You'd want to ensure the versions of plugins across both are the same.
Alternatively, you could use an additional config file for development. You would set the a different value for plugins field in the _config-dev.yml file which would overwrite your value in _config.yml. You'd need to ensure your plugins are not set in the :jekyll_plugins group in your Gemfile for this to work (as this would shortcut the config setting):
$ bundle exec jekyll build --config _config.yml,_config-dev.yml
General Performance
If your site has a large number of posts, it's likely that your biggest time saving would be made by processing less of them at development time. You can do this with the limit_posts command line option (https://jekyllrb.com/docs/configuration/options/#build-command-options):
$ bundle exec jekyll build --limit_posts 5
For general build time improvements, I'd highly recommend profiling your site to find the best place to optimise:
$ bundle exec jekyll build --profile

Jekyll SystemStackErorr "stack level too deep" on serve with github pages

I can't serve a jekyll site locally and I get notified that there is a problem with GitHub pages when I commit to GitHub.
bundle exec jekyll -v 11:28:34
jekyll 3.7.3
ruby --version 11:28:42
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
When I run:
bundle exec jekyll serve
will fail and spit out hundreds (more like thousnads) of error messages starting with:
bundler: failed to load command: jekyll (/usr/local/bin/jekyll)
SystemStackError: stack level too deep
/usr/local/lib/ruby/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/parser/base.rb:106:in `new'
/usr/local/lib/ruby/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/parser/base.rb:106:in `add_text'
/usr/local/lib/ruby/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/parser/html.rb:171:in `parse_raw_html'
/usr/local/lib/ruby/gems/2.5.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/html.rb:60:in `handle_kramdown_html_tag'
From what I could tell, this can sometimes happen if you use jekyll serve as opposed to bundle exec jekyll serve and if there is a mismatch between your version of jekyll and the one required by github pages, but here I do use bundle exec and so the correct version of jekyll is used.
jekyll itself works if i try to create a new site with jekyll new blah and i can serve that one locally without a problem, but the combo of jekyll and github pages is giving me grief.
I am puzzled and do not know how to proceed.
All this is on Mac OS X 10.13.6.
Not relating to the original cause of the problem here, but i stumbled upon this and had the error stack level too deep. So i guess this might help someone.
I traced my problem to a field that i named as max in some yaml dictionary in the front matter. Maybe you have named a field which has a special meaning in jekyll.

Jekyll: Specify whether a plugin is active in the development environment

In my Jekyll site, I'm using the minify-html plugin. However, it causes the site build time to increase from 2-20 seconds to nearly 5 minutes, which is unacceptable during development. According to the documentation:
After installing, Jekyll's HTML output will be minified by default. If you configure env in your Jekyll configuration, HTML will be minified only when
env is set to production.
env: production
This documentation is useless as it doesn't explain how to configure env. As can be expected, setting env: production in _config.yml has no effect, as it doesn't specify what should vary based on environment. I've spent quite a lot of time searching the internet for how to make this work, but I've turned up nothing. As far as I can tell, env, along with any other method to vary by environment, is totally undocumented in Jekyll.
How can I set minify-html to only run when I call JEKYLL_ENV=production jekyll build?
PS: In case it's relevant, I installed minify-html by adding it to my Gemfile and running bundle.
no env variable set in `_config.yml``=> minification
env: production => minification
env: yolo or whatever or dev => no minification
You can have a development command, using a development config file that will override the default _config.yml. See command options
In a new _config_dev.yml, set :
env: dev
To serve minified : jekyll serve.
To serve unminified : jekyll serve --config _config.yml,_config_dev.yml

Can't get github hosting to work with Jekyll 3.0.0

I am new to both Jekyll and github. I have followed the instructions here to get a blog on github using Jekyll. When I type jekyll serve from my local directory I get
D:/projects/gitblog/MyName.github.com/jekyll-bootstrap/_plugins/debug.rb:13:in `<module:Jekyll>': cannot load such file -- jekyll/post (LoadError)
Can someone help me with this? Based on some thing I have read, this might be a problem with the latest version of Jekyll, which I am using,
Try deleting the file _plugins/debug.rb and run the server again.

Install Laravel 5 on Openshift - gives blank page

I installed Laravel 5 on Openshift via Git. Hitting my app (the clean install) in a browser returns a blank page. Any idea what could be the cause?
Here is the URL: http://dev-rogercreasy.rhcloud.com/
Looks like you have old composer. I had the same error. To fix it go to your php dir and update composer.
In my case I gone to folder where placed my php.exe and ran command composer self-update:
cd d:\work\OpenServer\modules\php\PHP-5.5>D:\work\OpenServer\modules\php\PHP-5.5\
composer self-update
After it I gone back to folder with project and composer install command completed without any errors.
Check out the Laravel 5 QuickStart. The QuickStart uses a custom version of the standard OpenShift PHP 5.4 cartridge. The only difference is the included version of Composer has been updated.