Changed do_not_track setting to respectfully_social. Added a better description to the config file. Also, now social icons are sprited for bandwidth friendliness

This commit is contained in:
Brandon Mathis 2012-06-05 12:39:23 -05:00
parent 64b2d2355d
commit 44118878d7
11 changed files with 56 additions and 30 deletions

View File

@ -1,22 +1,47 @@
@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; color: $color;
&:visited, &:hover, &:visited:hover { color: $color; } &:visited, &:hover, &:visited:hover { color: $color; }
position: relative; @if $img {
padding-left: image-width($img) + 6px; padding-left: image-width($img) + 6px;
&:before { &:before {
content: ""; background: image-url($img) no-repeat center center;
background: image-url($img) no-repeat center center; width: image-width($img);
width: image-width($img); height: image-height($img);
height: image-height($img); position: absolute; left: 3px;
display: inline-block; top: 3px;
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 { .simple-social-button {
position: relative;
overflow: hidden;
font-family: "Lucida Grande", Helvetica, Arial, sans;
display: inline-block; display: inline-block;
border: 1px solid #ccc; 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; background-color: #e5e5e5;
@include background-image(linear-gradient(#fff, #ddd)); @include background-image(linear-gradient(#fff, #ddd));
&:hover { &:hover {
@ -24,12 +49,10 @@
border-color: #b5b5b5; border-color: #b5b5b5;
background-color: #ddd; background-color: #ddd;
} }
padding: .2em .5em .1em; line-height: 1.45em; &:before {
font-size: 13px; content: "";
font-weight: bold; display: inline-block;
text-decoration: none; }
text-shadow: #fff 0 1px;
@include border-radius(.3em);
} }
.sharing { .sharing {
@ -43,13 +66,13 @@
.googleplus-share { .googleplus-share {
@extend .simple-social-button; @extend .simple-social-button;
@include social-button-bg('googleplus.png', #db583b); @include social-button-bg('googleplus', #db583b);
} }
.facebook-share { .facebook-share {
@extend .simple-social-button; @extend .simple-social-button;
@include social-button-bg('facebook.png', #4e5a9b); @include social-button-bg('facebook', #4e5a9b);
} }
.twitter-share, .sidebar a.twitter-follow-button { .twitter-share, .sidebar a.twitter-follow-button {
@extend .simple-social-button; @extend .simple-social-button;
@include social-button-bg('twitter.png'); @include social-button-bg('twitter');
} }

View File

@ -1,7 +1,7 @@
{% include disqus.html %} {% include disqus.html %}
{% unless site.do_not_track %} {% unless site.respectfully_social %}
{% include facebook_like.html %} {% include facebook_like.html %}
{% include google_plus_one.html %} {% include google_plus_one.html %}
{% include twitter_sharing.html %} {% include twitter_sharing.html %}
{% endunless %} {% endunless %}
{% include custom/after_footer.html %} {% include custom/after_footer.html %}

View File

@ -1,20 +1,20 @@
<div class="sharing"> <div class="sharing">
{% if site.twitter_tweet_button %} {% 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> <a href="http://twitter.com/share" title="Tweet this" class="twitter-share" target="_blank">Tweet</a>
{% else %} {% 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 %}
{% endif %} {% endif %}
{% if site.google_plus_one %} {% 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> <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 %} {% else %}
<div class="g-plusone" data-size="{{ site.google_plus_one_size }}"></div> <div class="g-plusone" data-size="{{ site.google_plus_one_size }}"></div>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if site.facebook_like %} {% 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> <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 %} {% else %}
<div class="fb-like" data-send="true" data-width="450" data-show-faces="false"></div> <div class="fb-like" data-send="true" data-width="450" data-show-faces="false"></div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

View File

Before

Width:  |  Height:  |  Size: 302 B

After

Width:  |  Height:  |  Size: 302 B

View File

@ -65,8 +65,9 @@ default_asides: [asides/recent_posts.html, asides/github.html, asides/twitter.ht
# 3rd Party Settings # # 3rd Party Settings #
# ----------------------- # # ----------------------- #
# Use text links instead of Javascript widgets for Twitter, Facebook and Google Plus # Javascript social buttons often generate lots of http requests and may track viewers browsing history
do_not_track: false # Show respect for privacy and bandwidth with simple links for Twitter, Facebook and Google Plus.
respectfully_social: true
# Github repositories # Github repositories
github_user: github_user:

View File

@ -4,6 +4,7 @@ project_type = :stand_alone
# Publishing paths # Publishing paths
http_path = "/" http_path = "/"
http_images_path = "/images" http_images_path = "/images"
http_generated_images_path = "/images"
http_fonts_path = "/fonts" http_fonts_path = "/fonts"
css_dir = "public/stylesheets" css_dir = "public/stylesheets"
@ -11,6 +12,7 @@ css_dir = "public/stylesheets"
sass_dir = "sass" sass_dir = "sass"
images_dir = "source/images" images_dir = "source/images"
fonts_dir = "source/fonts" fonts_dir = "source/fonts"
generated_images_dir = "source/images"
line_comments = false line_comments = false
output_style = :compressed output_style = :compressed