Skip to content

Commit

Permalink
Add new Integration points for themes
Browse files Browse the repository at this point in the history
The new system will try to namespace all framework integrations with 'JB'. Integration points added in this comment are 'analytics', 'comments', and 'sharing'.
  • Loading branch information
plusjade committed Jan 21, 2012
1 parent 241a512 commit 7a0b1ed
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 0 deletions.
12 changes: 12 additions & 0 deletions _includes/JB/analytics
@@ -0,0 +1,12 @@
{% if site.safe and site.JB.analytics.engine and page.JB.analytics != false %}

{% case site.JB.analytics.engine %}
{% when "google" %}
{% include JB/analytics-engines/google.html %}
{% when "getclicky" %}
{% include JB/analytics-engines/getclicky.html %}
{% when "custom" %}
{% include custom/analytics.html %}
{% endcase %}

{% endif %}
12 changes: 12 additions & 0 deletions _includes/JB/analytics-engines/getclicky.html
@@ -0,0 +1,12 @@
<script type="text/javascript">
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push({{ site.JB.analytics.getclicky.site_id }});
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//static.getclicky.com/js';
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/66527741ns.gif" /></p></noscript>
11 changes: 11 additions & 0 deletions _includes/JB/analytics-engines/google.html
@@ -0,0 +1,11 @@
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ site.JB.analytics.google.tracking_id }}']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
16 changes: 16 additions & 0 deletions _includes/JB/comments
@@ -0,0 +1,16 @@
{% if site.JB.comments.engine and page.JB.comments != false %}

{% case site.JB.comments.engine %}
{% when "disqus" %}
{% include JB/comments-engines/disqus.html %}
{% when "livefyre" %}
{% include JB/comments-engines/livefyre.html %}
{% when "intensedebate" %}
{% include JB/comments-engines/intensedebate.html %}
{% when "facebook" %}
{% include JB/comments-engines/facebook.html %}
{% when "custom" %}
{% include custom/comments.html %}
{% endcase %}

{% endif %}
13 changes: 13 additions & 0 deletions _includes/JB/comments-engines/disqus.html
@@ -0,0 +1,13 @@
<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
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
1 change: 1 addition & 0 deletions _includes/JB/comments-engines/facebook.html
@@ -0,0 +1 @@
<h3>Facebook comments TODO!</h3>
6 changes: 6 additions & 0 deletions _includes/JB/comments-engines/intensedebate.html
@@ -0,0 +1,6 @@
<script>
var idcomments_acct = '{{ site.JB.comments.intensedebate.account }}';
var idcomments_post_id;
var idcomments_post_url;
</script>
<script type="text/javascript" src="http://www.intensedebate.com/js/genericLinkWrapperV2.js"></script>
6 changes: 6 additions & 0 deletions _includes/JB/comments-engines/livfyre.html
@@ -0,0 +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 }}
});
</script>
8 changes: 8 additions & 0 deletions _includes/JB/sharing
@@ -0,0 +1,8 @@
{% if site.safe and site.JB.sharing.engine and page.JB.sharing != false %}

{% case site.JB.sharing.engine %}
{% when "custom" %}
{% include custom/sharing.html %}
{% endcase %}

{% endif %}

0 comments on commit 7a0b1ed

Please sign in to comment.