Skip to content

Commit

Permalink
Merge pull request #17 from bf4/move_jb_config_to_data
Browse files Browse the repository at this point in the history
Move site.JB config to site.data.JB
  • Loading branch information
bf4 committed Oct 3, 2017
2 parents 01a28fa + 6aab912 commit fdf3106
Show file tree
Hide file tree
Showing 19 changed files with 129 additions and 33 deletions.
96 changes: 96 additions & 0 deletions _data/JB.yml
@@ -0,0 +1,96 @@
# All Jekyll-Bootstrap specific configurations are namespaced into this hash
version : 0.3.0

# All links will be namespaced by BASE_PATH if defined.
# Links in your website should always be prefixed with {{BASE_PATH}}
# however this value will be dynamically changed depending on your deployment situation.
#
# CNAME (http://yourcustomdomain.com)
# DO NOT SET BASE_PATH
# (urls will be prefixed with "/" and work relatively)
#
# GitHub Pages (http://username.github.com)
# DO NOT SET BASE_PATH
# (urls will be prefixed with "/" and work relatively)
#
# GitHub Project Pages (http://username.github.com/project-name)
#
# A GitHub Project site exists in the `gh-pages` branch of one of your repositories.
# REQUIRED! Set BASE_PATH to: http://username.github.com/project-name
#
# CAUTION:
# - When in Localhost, your site will run from root "/" regardless of BASE_PATH
# - Only the following values are falsy: ["", null, false]
# - When setting BASE_PATH it must be a valid url.
# This means always setting the protocol (http|https) or prefixing with "/"
BASE_PATH : false

# By default, the asset_path is automatically defined relative to BASE_PATH plus the enabled theme.
# ex: [BASE_PATH]/assets/themes/[THEME-NAME]
#
# Override this by defining an absolute path to assets here.
# ex:
# http://s3.amazonaws.com/yoursite/themes/watermelon
# /assets
#
ASSET_PATH : false

# These paths are to the main pages Jekyll-Bootstrap ships with.
# Some JB helpers refer to these paths; change them here if needed.
#
archive_path: /archive.html
categories_path : /categories.html
tags_path : /tags.html
atom_path : /atom.xml
rss_path : /rss.xml

# Settings for comments helper
# Set 'provider' to the comment provider you want to use.
# Set 'provider' to false to turn commenting off globally.
#
comments :
provider : disqus
disqus :
short_name : benjaminfleischer
livefyre :
site_id : 123
intensedebate :
account : 123abc
facebook :
appid : 123
num_posts: 5
width: 580
colorscheme: light

# Settings for analytics helper
# Set 'provider' to the analytics provider you want to use.
# Set 'provider' to false to turn analytics off globally.
#
analytics :
provider : google
google :
tracking_id : 'UA-4481984-10'
getclicky :
site_id :
mixpanel :
token : '_MIXPANEL_TOKEN_'

# Settings for sharing helper.
# Sharing is for things like tweet, plusone, like, reddit buttons etc.
# Set 'provider' to the sharing provider you want to use.
# Set 'provider' to false to turn sharing off globally.
#
sharing :
provider : tweet

# Settings for all other include helpers can be defined by creating
# a hash with key named for the given helper. ex:
#
# pages_list :
# provider : "custom"
#
# Setting any helper's provider to 'custom' will bypass the helper code
# and include your custom code. Your custom file must be defined at:
# ./_includes/custom/[HELPER]
# where [HELPER] is the name of the helper you are overriding.

4 changes: 2 additions & 2 deletions _includes/JB/analytics
@@ -1,6 +1,6 @@
{% if site.safe and site.JB.analytics.provider and page.JB.analytics != false %}
{% if site.safe and site.data.JB.analytics.provider and page.JB.analytics != false %}

{% case site.JB.analytics.provider %}
{% case site.data.JB.analytics.provider %}
{% when "google" %}
{% include JB/analytics-providers/google %}
{% when "getclicky" %}
Expand Down
4 changes: 2 additions & 2 deletions _includes/JB/analytics-providers/getclicky
@@ -1,6 +1,6 @@
<script type="text/javascript">
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push({{ site.JB.analytics.getclicky.site_id }});
clicky_site_ids.push({{ site.data.JB.analytics.getclicky.site_id }});
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
Expand All @@ -9,4 +9,4 @@ clicky_site_ids.push({{ site.JB.analytics.getclicky.site_id }});
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/{{ site.JB.analytics.getclicky.site_id }}ns.gif" /></p></noscript>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/{{ site.data.JB.analytics.getclicky.site_id }}ns.gif" /></p></noscript>
2 changes: 1 addition & 1 deletion _includes/JB/analytics-providers/google
@@ -1,6 +1,6 @@
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ site.JB.analytics.google.tracking_id }}']);
_gaq.push(['_setAccount', '{{ site.data.JB.analytics.google.tracking_id }}']);
_gaq.push(['_trackPageview']);

(function() {
Expand Down
2 changes: 1 addition & 1 deletion _includes/JB/analytics-providers/mixpanel
@@ -1,6 +1,6 @@
<script type="text/javascript">
var mpq = [];
mpq.push(["init", "{{ site.JB.analytics.mixpanel.token}}"]);
mpq.push(["init", "{{ site.data.JB.analytics.mixpanel.token}}"]);
(function(){var b,a,e,d,c;b=document.createElement("script");b.type="text/javascript";
b.async=true;b.src=(document.location.protocol==="https:"?"https:":"http:")+
"//api.mixpanel.com/site_media/js/api/mixpanel.js";a=document.getElementsByTagName("script")[0];
Expand Down
6 changes: 3 additions & 3 deletions _includes/JB/categories_list
Expand Up @@ -17,18 +17,18 @@ Usage:
This helper can be seen in use at: ../_layouts/default.html
-->{% endcomment %}

{% if site.JB.categories_list.provider == "custom" %}
{% if site.data.JB.categories_list.provider == "custom" %}
{% include custom/categories_list %}
{% else %}
{% if categories_list.first[0] == null %}
{% for category in categories_list %}
<li><a href="{{ BASE_PATH }}{{ site.JB.categories_path }}#{{ category }}-ref">
<li><a href="{{ BASE_PATH }}{{ site.data.JB.categories_path }}#{{ category }}-ref">
{{ category | join: "/" }} <span>{{ site.categories[category].size }}</span>
</a></li>
{% endfor %}
{% else %}
{% for category in categories_list %}
<li><a href="{{ BASE_PATH }}{{ site.JB.categories_path }}#{{ category[0] }}-ref">
<li><a href="{{ BASE_PATH }}{{ site.data.JB.categories_path }}#{{ category[0] }}-ref">
{{ category[0] | join: "/" }} <span>{{ category[1].size }}</span>
</a></li>
{% endfor %}
Expand Down
4 changes: 2 additions & 2 deletions _includes/JB/comments
@@ -1,6 +1,6 @@
{% if site.JB.comments.provider and page.comments != false %}
{% if site.data.JB.comments.provider and page.comments != false %}

{% case site.JB.comments.provider %}
{% case site.data.JB.comments.provider %}
{% when "disqus" %}
{% include JB/comments-providers/disqus %}
{% when "livefyre" %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/JB/comments-providers/disqus
@@ -1,7 +1,7 @@
<div id="disqus_thread"></div>
<script type="text/javascript">
{% if site.safe == false %}var disqus_developer = 1;{% endif %}
var disqus_shortname = '{{ site.JB.comments.disqus.short_name }}'; // required: replace example with your forum shortname
var disqus_shortname = '{{ site.data.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 * * */
(function() {
Expand Down
4 changes: 2 additions & 2 deletions _includes/JB/comments-providers/facebook
Expand Up @@ -3,7 +3,7 @@
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId={{ site.JB.comments.facebook.appid }}";
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId={{ site.data.JB.comments.facebook.appid }}";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="{{ site.production_url }}" data-num-posts="{{ site.JB.comments.facebook.num_posts }}" data-width="{{ site.JB.comments.facebook.width }}" data-colorscheme="{{ site.JB.comments.facebook.colorscheme }}"></div>
<div class="fb-comments" data-href="{{ site.production_url }}" data-num-posts="{{ site.data.JB.comments.facebook.num_posts }}" data-width="{{ site.data.JB.comments.facebook.width }}" data-colorscheme="{{ site.data.JB.comments.facebook.colorscheme }}"></div>
2 changes: 1 addition & 1 deletion _includes/JB/comments-providers/intensedebate
@@ -1,5 +1,5 @@
<script>
var idcomments_acct = '{{ site.JB.comments.intensedebate.account }}';
var idcomments_acct = '{{ site.data.JB.comments.intensedebate.account }}';
var idcomments_post_id;
var idcomments_post_url;
</script>
Expand Down
2 changes: 1 addition & 1 deletion _includes/JB/comments-providers/livefyre
@@ -1,6 +1,6 @@
<script type='text/javascript' src='http://zor.livefyre.com/wjs/v1.0/javascripts/livefyre_init.js'></script>
<script type='text/javascript'>
var fyre = LF({
site_id: {{ site.JB.comments.livefyre.site_id }}
site_id: {{ site.data.JB.comments.livefyre.site_id }}
});
</script>
2 changes: 1 addition & 1 deletion _includes/JB/liquid_raw
Expand Up @@ -24,7 +24,7 @@ Usage:
As seen here, you must use "|." and ".|" as opening and closing brackets.
-->{% endcomment%}

{% if site.JB.liquid_raw.provider == "custom" %}
{% if site.data.JB.liquid_raw.provider == "custom" %}
{% include custom/liquid_raw %}
{% else %}
<pre><code>{{text | replace:"|.", "&#123;" | replace:".|", "&#125;" | replace:">", "&gt;" | replace:"<", "&lt;" }}</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion _includes/JB/pages_list
Expand Up @@ -20,7 +20,7 @@ Usage:
This helper can be seen in use at: ../_layouts/default.html
-->{% endcomment %}

{% if site.JB.pages_list.provider == "custom" %}
{% if site.data.JB.pages_list.provider == "custom" %}
{% include custom/pages_list %}
{% else %}
{% for node in pages_list %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/JB/posts_collate
Expand Up @@ -17,7 +17,7 @@ Usage:

-->{% endcomment %}

{% if site.JB.posts_collate.provider == "custom" %}
{% if site.data.JB.posts_collate.provider == "custom" %}
{% include custom/posts_collate %}
{% else %}
{% for post in posts_collate %}
Expand Down
12 changes: 6 additions & 6 deletions _includes/JB/setup
Expand Up @@ -2,19 +2,19 @@
<!--
- Dynamically set liquid variables for working with URLs/paths
-->
{% if site.JB.setup.provider == "custom" %}
{% if site.data.JB.setup.provider == "custom" %}
{% include custom/setup %}
{% else %}
{% if site.safe and site.JB.BASE_PATH and site.JB.BASE_PATH != '' %}
{% assign BASE_PATH = site.JB.BASE_PATH %}
{% assign HOME_PATH = site.JB.BASE_PATH %}
{% if site.safe and site.data.JB.BASE_PATH and site.data.JB.BASE_PATH != '' %}
{% assign BASE_PATH = site.data.JB.BASE_PATH %}
{% assign HOME_PATH = site.data.JB.BASE_PATH %}
{% else %}
{% assign BASE_PATH = nil %}
{% assign HOME_PATH = "/" %}
{% endif %}

{% if site.JB.ASSET_PATH %}
{% assign ASSET_PATH = site.JB.ASSET_PATH %}
{% if site.data.JB.ASSET_PATH %}
{% assign ASSET_PATH = site.data.JB.ASSET_PATH %}
{% else %}
{% capture ASSET_PATH %}{{ BASE_PATH }}/assets/themes/{{ layout.theme.name }}{% endcapture %}
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions _includes/JB/sharing
@@ -1,6 +1,6 @@
{% if site.safe and site.JB.sharing.provider and page.JB.sharing != false %}
{% if site.safe and site.data.JB.sharing.provider and page.JB.sharing != false %}

{% case site.JB.sharing.provider %}
{% case site.data.JB.sharing.provider %}
{% when "custom" %}
{% include custom/sharing %}
{% endcase %}
Expand Down
6 changes: 3 additions & 3 deletions _includes/JB/tags_list
Expand Up @@ -17,16 +17,16 @@ Usage:
This helper can be seen in use at: ../_layouts/default.html
-->{% endcomment %}

{% if site.JB.tags_list.provider == "custom" %}
{% if site.data.JB.tags_list.provider == "custom" %}
{% include custom/tags_list %}
{% else %}
{% if tags_list.first[0] == null %}
{% for tag in tags_list %}
<li><a href="{{ BASE_PATH }}{{ site.JB.tags_path }}#{{ tag }}-ref">{{ tag }} <span>{{ site.tags[tag].size }}</span></a></li>
<li><a href="{{ BASE_PATH }}{{ site.data.JB.tags_path }}#{{ tag }}-ref">{{ tag }} <span>{{ site.tags[tag].size }}</span></a></li>
{% endfor %}
{% else %}
{% for tag in tags_list %}
<li><a href="{{ BASE_PATH }}{{ site.JB.tags_path }}#{{ tag[0] }}-ref">{{ tag[0] }} <span>{{ tag[1].size }}</span></a></li>
<li><a href="{{ BASE_PATH }}{{ site.data.JB.tags_path }}#{{ tag[0] }}-ref">{{ tag[0] }} <span>{{ tag[1].size }}</span></a></li>
{% endfor %}
{% endif %}
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions _includes/themes/left/default.html
Expand Up @@ -51,8 +51,8 @@
<link rel="apple-touch-icon" sizes="114x114" href="{{ BASE_PATH }}/assets/apple-touch-icon-114x114.png">

<!-- atom & rss feed -->
<link href="{{ BASE_PATH }}{{ site.JB.atom_path }}" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed">
<link href="{{ BASE_PATH }}{{ site.JB.rss_path }}" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed">
<link href="{{ BASE_PATH }}{{ site.data.JB.atom_path }}" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed">
<link href="{{ BASE_PATH }}{{ site.data.JB.rss_path }}" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed">

</head>

Expand Down
2 changes: 1 addition & 1 deletion _includes/themes/left/post.html
Expand Up @@ -38,7 +38,7 @@ <h1>{{ page.title }} {% if page.tagline %}<small>{{page.tagline}}</small>{% endi
{% else %}
<li class="prev disabled"><a>&larr; Previous</a></li>
{% endif %}
<li><a href="{{ BASE_PATH }}{{ site.JB.archive_path }}">Archive</a></li>
<li><a href="{{ BASE_PATH }}{{ site.data.JB.archive_path }}">Archive</a></li>
{% if page.next %}
<li class="next"><a href="{{ BASE_PATH }}{{ page.next.url }}" title="{{ page.next.title }}">Next &rarr;</a></li>
{% else %}
Expand Down

0 comments on commit fdf3106

Please sign in to comment.