summaryrefslogtreecommitdiff
path: root/_includes/JB/is_production
blob: 3548f8c3d05f2fa0ad2e9709c6a9e60bbf166e4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{% capture jbcache %}{% comment %}

  Determine whether or not the site is being built in a production environment.
  
  Parameters:
    None.

  Returns:
    is_production: [true|false]
    jb_prod_env: [development|github|other]

  Examples:
  
    {% include JB/is_production %}
    
    {% if is_production != true %}
      <h3>This is Private</h3>
      <p>I love to watch television in my undies. Don't tell anyone!</p>
    {% endif %}
    
    <h3>This is Public</h3>
    <p>I have no unusual quirks.</p>

{% endcomment %}

{% assign is_production = false %}
{% assign jb_prod_env = "development" %}

{% if jekyll.environment != "development" %}
  {% assign is_production = true %}
  {% assign jb_prod_env = jekyll.environment %}
{% endif %}

{% if site.github %}
  {% assign is_production = true %}
  {% assign jb_prod_env = "github" %}
{% endif %}

{% endcapture %}{% assign jbcache = nil %}