Fixes issue #84.
This commit is contained in:
parent
3481cfab6a
commit
35876ce06a
5 changed files with 48 additions and 4 deletions
|
@ -1,4 +1,6 @@
|
|||
{% if site.safe and site.JB.analytics.provider and page.JB.analytics != false %}
|
||||
{% include JB/is_production %}
|
||||
|
||||
{% if is_production and site.JB.analytics.provider and page.JB.analytics != false %}
|
||||
|
||||
{% case site.JB.analytics.provider %}
|
||||
{% when "google" %}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<div id="disqus_thread"></div>
|
||||
<script type="text/javascript">
|
||||
{% if site.safe == false %}var disqus_developer = 1;{% endif %}
|
||||
{% include JB/is_production %}
|
||||
{% if is_production == false %}var disqus_developer = 1;{% endif %}
|
||||
var disqus_shortname = '{{ site.JB.comments.disqus.short_name }}'; // required: replace example with your forum shortname
|
||||
{% if page.wordpress_id %}var disqus_identifier = '{{page.wordpress_id}} {{site.production_url}}/?p={{page.wordpress_id}}';{% endif %}
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
|
|
39
_includes/JB/is_production
Normal file
39
_includes/JB/is_production
Normal file
|
@ -0,0 +1,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 %}
|
|
@ -2,10 +2,11 @@
|
|||
<!--
|
||||
- Dynamically set liquid variables for working with URLs/paths
|
||||
-->
|
||||
{% include JB/is_production %}
|
||||
{% if site.JB.setup.provider == "custom" %}
|
||||
{% include custom/setup %}
|
||||
{% else %}
|
||||
{% if site.safe and site.JB.BASE_PATH and site.JB.BASE_PATH != '' %}
|
||||
{% if is_production and site.JB.BASE_PATH and site.JB.BASE_PATH != '' %}
|
||||
{% assign BASE_PATH = site.JB.BASE_PATH %}
|
||||
{% assign HOME_PATH = site.JB.BASE_PATH %}
|
||||
{% else %}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% if site.safe and site.JB.sharing.provider and page.JB.sharing != false %}
|
||||
{% include JB/is_production %}
|
||||
{% if is_production and site.JB.sharing.provider and page.JB.sharing != false %}
|
||||
|
||||
{% case site.JB.sharing.provider %}
|
||||
{% when "custom" %}
|
||||
|
|
Loading…
Add table
Reference in a new issue