Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Add baidu in analytics provider, add tip for enabling analytics plugin #158

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ JB :
colorscheme: light

# Settings for analytics helper
# Set 'site.safe' to true to enable analytics plugin
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@themez we've moved away from using site.safe to decide if the site is in production mode. I'm killing this line and merging the rest.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@themez, crap. I can't edit inline. I will have to resubmit this using my account, or you can make the tweak on your end and I'll merge. Lemme know.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@themez, double crap. This now has merge conflicts. Will have to create new PR. If you don't have time or desire, I'll handle it. Thanks for contribution!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi ground0g, I've already deleted my fork repo, cannot make a new pr now.. It would be good if you can fix it with your account.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. Thanks for the contribution! Sorry it's taken so long to review.

# Set 'provider' to the analytics provider you want to use.
# Set 'provider' to false to turn analytics off globally.
#
Expand All @@ -106,6 +107,8 @@ JB :
site_id :
mixpanel :
token : '_MIXPANEL_TOKEN_'
baidu :
token : '_BAIDU_TOKEN_'

# Settings for sharing helper.
# Sharing is for things like tweet, plusone, like, reddit buttons etc.
Expand Down
4 changes: 3 additions & 1 deletion _includes/JB/analytics
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
{% include JB/analytics-providers/getclicky %}
{% when "mixpanel" %}
{% include JB/analytics-providers/mixpanel %}
{% when "baidu" %}
{% include JB/analytics-providers/baidu %}
{% when "custom" %}
{% include custom/analytics %}
{% endcase %}

{% endif %}
{% endif %}
4 changes: 4 additions & 0 deletions _includes/JB/analytics-providers/baidu
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%{{ site.JB.analytics.baidu.token }}' type='text/javascript'%3E%3C/script%3E"));
</script>