is_production 900 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. {% capture jbcache %}{% comment %}
  2. Determine whether or not the site is being built in a production environment.
  3. Parameters:
  4. None.
  5. Returns:
  6. is_production: [true|false]
  7. jb_prod_env: [development|github|other]
  8. Examples:
  9. {% include JB/is_production %}
  10. {% if is_production != true %}
  11. <h3>This is Private</h3>
  12. <p>I love to watch television in my undies. Don't tell anyone!</p>
  13. {% endif %}
  14. <h3>This is Public</h3>
  15. <p>I have no unusual quirks.</p>
  16. {% endcomment %}
  17. {% assign is_production = false %}
  18. {% assign jb_prod_env = "development" %}
  19. {% if jekyll.environment != "development" %}
  20. {% assign is_production = true %}
  21. {% assign jb_prod_env = jekyll.environment %}
  22. {% endif %}
  23. {% if site.github %}
  24. {% assign is_production = true %}
  25. {% assign jb_prod_env = "github" %}
  26. {% endif %}
  27. {% endcapture %}{% assign jbcache = nil %}