Skip to content

Commit 45bf884

Browse files
committed
Backport of plusjade/jekyll-bootstrap#262 for website
1 parent 9647ba4 commit 45bf884

File tree

5 files changed

+48
-4
lines changed

5 files changed

+48
-4
lines changed

_includes/JB/analytics

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
{% if site.safe and site.JB.analytics.provider and page.JB.analytics != false %}
1+
{% include JB/is_production %}
2+
3+
{% if is_production and site.JB.analytics.provider and page.JB.analytics != false %}
24

35
{% case site.JB.analytics.provider %}
46
{% when "google_classic" %}

_includes/JB/comments-providers/disqus

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<div id="disqus_thread"></div>
22
<script type="text/javascript">
3-
{% if site.safe == false %}var disqus_developer = 1;{% endif %}
3+
{% include JB/is_production %}
4+
{% if is_production == false %}var disqus_developer = 1;{% endif %}
45
var disqus_shortname = '{{ site.JB.comments.disqus.short_name }}'; // required: replace example with your forum shortname
56
{% if page.wordpress_id %}var disqus_identifier = '{{page.wordpress_id}} {{site.production_url}}/?p={{page.wordpress_id}}';{% endif %}
67
/* * * DON'T EDIT BELOW THIS LINE * * */

_includes/JB/is_production

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

_includes/JB/setup

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
<!--
33
- Dynamically set liquid variables for working with URLs/paths
44
-->
5+
{% include JB/is_production %}
56
{% if site.JB.setup.provider == "custom" %}
67
{% include custom/setup %}
78
{% else %}
8-
{% if site.safe and site.JB.BASE_PATH and site.JB.BASE_PATH != '' %}
9+
{% if is_production and site.JB.BASE_PATH and site.JB.BASE_PATH != '' %}
910
{% assign BASE_PATH = site.JB.BASE_PATH %}
1011
{% assign HOME_PATH = site.JB.BASE_PATH %}
1112
{% else %}

_includes/JB/sharing

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{% if site.safe and site.JB.sharing.provider and page.JB.sharing != false %}
1+
{% include JB/is_production %}
2+
{% if is_production and site.JB.sharing.provider and page.JB.sharing != false %}
23

34
{% case site.JB.sharing.provider %}
45
{% when "custom" %}

0 commit comments

Comments
 (0)