Skip to content

Commit

Permalink
Changed do_not_track setting to respectfully_social. Added a better d…
Browse files Browse the repository at this point in the history
…escription to the config file. Also, now social icons are sprited for bandwidth friendliness
  • Loading branch information
imathis committed Jun 5, 2012
1 parent 64b2d23 commit 4411887
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 30 deletions.
63 changes: 43 additions & 20 deletions .themes/classic/sass/partials/_sharing.scss
@@ -1,35 +1,58 @@
@mixin social-button-bg($img, $color: #444) {
@import "icon/*.png";/**/
@include all-icon-sprites($dimensions: true);

@mixin social-button-bg($icon: false, $color: #333, $img: false) {
color: $color;
&:visited, &:hover, &:visited:hover { color: $color; }
position: relative;
padding-left: image-width($img) + 6px;
&:before {
content: "";
background: image-url($img) no-repeat center center;
width: image-width($img);
height: image-height($img);
display: inline-block;
position: absolute; left: 3px;
top: 3px;
@if $img {
padding-left: image-width($img) + 6px;
&:before {
background: image-url($img) no-repeat center center;
width: image-width($img);
height: image-height($img);
position: absolute; left: 3px;
top: 3px;
}
} @else if $icon {
padding-left: icon-sprite-width($icon) + 6px;
&:before {
vertical-align: middle;
@extend .icon-#{$icon};
position: absolute; left: 3px;
top: 3px;
}
}
}

@mixin icon-bg($icon, $align: middle) {
display: inline-block;
vertical-align: $align;
@extend .icon-#{$icon};
}

.simple-social-button {
position: relative;
overflow: hidden;
font-family: "Lucida Grande", Helvetica, Arial, sans;
display: inline-block;
border: 1px solid #ccc;
padding: .2em .5em; line-height: 1.45em;
font-size: 11px;
font-weight: bold;
text-decoration: none;
text-shadow: #fff 0 1px;
@include border-radius(.3em);
background-color: #e5e5e5;
@include background-image(linear-gradient(#fff, #ddd));
&:hover {
@include background-image(linear-gradient(#f5f5f5, #ccc));
border-color: #b5b5b5;
background-color: #ddd;
}
padding: .2em .5em .1em; line-height: 1.45em;
font-size: 13px;
font-weight: bold;
text-decoration: none;
text-shadow: #fff 0 1px;
@include border-radius(.3em);
&:before {
content: "";
display: inline-block;
}
}

.sharing {
Expand All @@ -43,13 +66,13 @@

.googleplus-share {
@extend .simple-social-button;
@include social-button-bg('googleplus.png', #db583b);
@include social-button-bg('googleplus', #db583b);
}
.facebook-share {
@extend .simple-social-button;
@include social-button-bg('facebook.png', #4e5a9b);
@include social-button-bg('facebook', #4e5a9b);
}
.twitter-share, .sidebar a.twitter-follow-button {
@extend .simple-social-button;
@include social-button-bg('twitter.png');
@include social-button-bg('twitter');
}
8 changes: 4 additions & 4 deletions .themes/classic/source/_includes/after_footer.html
@@ -1,7 +1,7 @@
{% include disqus.html %}
{% unless site.do_not_track %}
{% include facebook_like.html %}
{% include google_plus_one.html %}
{% include twitter_sharing.html %}
{% unless site.respectfully_social %}
{% include facebook_like.html %}
{% include google_plus_one.html %}
{% include twitter_sharing.html %}
{% endunless %}
{% include custom/after_footer.html %}
8 changes: 4 additions & 4 deletions .themes/classic/source/_includes/post/sharing.html
@@ -1,20 +1,20 @@
<div class="sharing">
{% if site.twitter_tweet_button %}
{% if site.do_not_track %}
{% if site.respectfully_social %}
<a href="http://twitter.com/share" title="Tweet this" class="twitter-share" target="_blank">Tweet</a>
{% else %}
<a href="http://twitter.com/share" title="Tweet this" class="twitter-share-button twitter-share" data-url="{{ site.url }}{{ page.url }}" data-via="{{ site.twitter_user }}" data-counturl="{{ site.url }}{{ page.url }}" target="_blank" >Tweet</a>
<a href="http://twitter.com/share" title="Tweet this" class="twitter-share-button" data-url="{{ site.url }}{{ page.url }}" data-via="{{ site.twitter_user }}" data-counturl="{{ site.url }}{{ page.url }}" target="_blank" >Tweet</a>
{% endif %}
{% endif %}
{% if site.google_plus_one %}
{% if site.do_not_track %}
{% if site.respectfully_social %}
<a title="+1 on Google Plus" class="googleplus-share" href="https://plusone.google.com/_/+1/confirm?hl=en&url={{site.url}}{{page.url}}" target="_blank">+1</a>
{% else %}
<div class="g-plusone" data-size="{{ site.google_plus_one_size }}"></div>
{% endif %}
{% endif %}
{% if site.facebook_like %}
{% if site.do_not_track %}
{% if site.respectfully_social %}
<a title="Share on Facebook" class="facebook-share" href="http://www.facebook.com/sharer.php?u={{site.url}}{{page.url}}" target="_blank">Share</a>
{% else %}
<div class="fb-like" data-send="true" data-width="450" data-show-faces="false"></div>
Expand Down
Binary file removed .themes/classic/source/images/facebook.png
Binary file not shown.
Binary file removed .themes/classic/source/images/googleplus.png
Binary file not shown.
Binary file added .themes/classic/source/images/icon-s02358152fa.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .themes/classic/source/images/icon/facebook.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .themes/classic/source/images/icon/googleplus.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
5 changes: 3 additions & 2 deletions _config.yml
Expand Up @@ -65,8 +65,9 @@ default_asides: [asides/recent_posts.html, asides/github.html, asides/twitter.ht
# 3rd Party Settings #
# ----------------------- #

# Use text links instead of Javascript widgets for Twitter, Facebook and Google Plus
do_not_track: false
# Javascript social buttons often generate lots of http requests and may track viewers browsing history
# Show respect for privacy and bandwidth with simple links for Twitter, Facebook and Google Plus.
respectfully_social: true

# Github repositories
github_user:
Expand Down
2 changes: 2 additions & 0 deletions config.rb
Expand Up @@ -4,13 +4,15 @@
# Publishing paths
http_path = "/"
http_images_path = "/images"
http_generated_images_path = "/images"
http_fonts_path = "/fonts"
css_dir = "public/stylesheets"

# Local development paths
sass_dir = "sass"
images_dir = "source/images"
fonts_dir = "source/fonts"
generated_images_dir = "source/images"

line_comments = false
output_style = :compressed

0 comments on commit 4411887

Please sign in to comment.