Unit 06 · lesson
Development vs Production Environments
A development build and a production build can intentionally behave differently.
Jekyll exposes the environment through JEKYLL_ENV / jekyll.environment.
The official deployment tutorial shows a production build such as:
JEKYLL_ENV=production bundle exec jekyll build
On PowerShell or Windows command environments, the exact environment-variable syntax differs. Use the syntax appropriate to your shell.
Build-time condition
{% if jekyll.environment == "production" %}
<p class="build-marker">Production build</p>
{% endif %}
Do not keep a silly marker in the final site. Use it to prove the mechanism.
Why environments exist
Possible legitimate differences:
- analytics only in production;
- production-only metadata;
- development diagnostics;
- environment-specific configuration files in a controlled workflow.
Risk: environment-specific surprises
If you only test development, production may be the first place you discover:
- missing plugin behavior;
- different URLs;
- conditional markup;
- different asset assumptions.
Experiment
Build once as development and once as production.
Keep outputs separately or compare before the second build overwrites the first.
Record one intentional difference.
Checkpoint
Explain why "production should be the same as development" is too simplistic, but "production can be completely different" is also dangerous.