From 44118878d781a0aed3613cfae8a1d803bd5c95d8 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Tue, 5 Jun 2012 12:39:23 -0500 Subject: [PATCH] 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 --- .themes/classic/sass/partials/_sharing.scss | 63 ++++++++++++------ .../source/_includes/after_footer.html | 8 +-- .../source/_includes/post/sharing.html | 8 +-- .themes/classic/source/images/facebook.png | Bin 209 -> 0 bytes .themes/classic/source/images/googleplus.png | Bin 365 -> 0 bytes .../source/images/icon-s02358152fa.png | Bin 0 -> 568 bytes .../classic/source/images/icon/facebook.png | Bin 0 -> 208 bytes .../classic/source/images/icon/googleplus.png | Bin 0 -> 353 bytes .../source/images/{ => icon}/twitter.png | Bin _config.yml | 5 +- config.rb | 2 + 11 files changed, 56 insertions(+), 30 deletions(-) delete mode 100644 .themes/classic/source/images/facebook.png delete mode 100644 .themes/classic/source/images/googleplus.png create mode 100644 .themes/classic/source/images/icon-s02358152fa.png create mode 100644 .themes/classic/source/images/icon/facebook.png create mode 100644 .themes/classic/source/images/icon/googleplus.png rename .themes/classic/source/images/{ => icon}/twitter.png (100%) diff --git a/.themes/classic/sass/partials/_sharing.scss b/.themes/classic/sass/partials/_sharing.scss index e6a220a..0f8a4ac 100644 --- a/.themes/classic/sass/partials/_sharing.scss +++ b/.themes/classic/sass/partials/_sharing.scss @@ -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; &: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 { @@ -24,12 +49,10 @@ 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 { @@ -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'); } diff --git a/.themes/classic/source/_includes/after_footer.html b/.themes/classic/source/_includes/after_footer.html index 2aee47f..0324a32 100644 --- a/.themes/classic/source/_includes/after_footer.html +++ b/.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 %} diff --git a/.themes/classic/source/_includes/post/sharing.html b/.themes/classic/source/_includes/post/sharing.html index 0e04abb..ed9ea72 100644 --- a/.themes/classic/source/_includes/post/sharing.html +++ b/.themes/classic/source/_includes/post/sharing.html @@ -1,20 +1,20 @@
{% if site.twitter_tweet_button %} - {% if site.do_not_track %} + {% if site.respectfully_social %} {% else %} - + {% endif %} {% endif %} {% if site.google_plus_one %} - {% if site.do_not_track %} + {% if site.respectfully_social %} +1 {% else %}
{% endif %} {% endif %} {% if site.facebook_like %} - {% if site.do_not_track %} + {% if site.respectfully_social %} {% else %}
diff --git a/.themes/classic/source/images/facebook.png b/.themes/classic/source/images/facebook.png deleted file mode 100644 index 4d02a33c9af0d21740b259659a496b8e261095e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^d_XL~!3HGNrubO_DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_d9Ma7;jjv*Ddl2Q&Z{aN%}jbUY-f|!F)-kmKbI~k899$a*i z(c^5o0>g|A9hL?Hj1e6Hi#bXjF(>7?Fy1g}WKf><{~NO=t43QRb3m2ig$b-X=Dcb+ zexBX4NK2@q;quCW=S`1R$(`))IpW41m=L0@Yr@1L!64lr@t>nJ+Yo3ygQu&X%Q~lo FCIHn~MWFxy diff --git a/.themes/classic/source/images/googleplus.png b/.themes/classic/source/images/googleplus.png deleted file mode 100644 index c92bbf3fa12b78d2bb5d8c0439dd82844ee0c3b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 365 zcmV-z0h0cSP)#o;#J7#~FM`_2 z)W*tL9FvycJ&+`n{Xd~Y1#kyzO^LitUjzgf>YJ-Sc&*t55N%|qk!VqemgN!c?D|4) zLT%F3jWrx1Ern!rBpq3iXQ3f1^q2aJ+rrGXS@$ehY^S?wK{ diff --git a/.themes/classic/source/images/icon-s02358152fa.png b/.themes/classic/source/images/icon-s02358152fa.png new file mode 100644 index 0000000000000000000000000000000000000000..6e40dd926f5c482492ac14087aa2211afa0cadcf GIT binary patch literal 568 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoQ!3-qz8@W<}R7HSKh%1oRnst?U-V3(|Ng&%LqfxTAPp8yK!``B&ws+e!07Jj z;uunKYwM&y|7HV`R{uf zSA;UwEHjyHygQmbAnBNj)4fWaj~#(^Aql5CRZXy}5j=n9*Hrxxp!_xoNs(im14|0XG>I=I;Ca22bTHuH@rw>6u47u&7ZongQ> zDSr z1<%~X^wgl##FWaylc_d9MMa)2jv*Ddl2RO)>n;`xH-y*=a4T?{=S9uB!;rLLfo2&) z&}YdH3~DC(n3)+5I61@#zL>)PBgcX9MVDiP;K{$g8>cXd96rFPu~%S4CF8Ei8+OX8 zl}*r4S8QaL@N2T-7PLci4h@V9yn7}7drX|~4z!)Y)78&qol`;+ E04)7M@Bjb+ literal 0 HcmV?d00001 diff --git a/.themes/classic/source/images/icon/googleplus.png b/.themes/classic/source/images/icon/googleplus.png new file mode 100644 index 0000000000000000000000000000000000000000..a0f785da84fedf855ff5b1ffd47656da9f79dbd4 GIT binary patch literal 353 zcmV-n0iOPeP)Tuu)Cvd{pcSYU=+PTm0bIP(fRPgHKxc4Xvc9;*(d9mbCK?eN*b<$n(Gx1hgi5Y{^bi@BNZ)ExDG? zP|^-IQ1&Yyp$4R}R5?0tz)W)_n&C?}>zk|pLM9Sj)nBp+db_p#&8${ZmCnpj7_jN~ z%z*&*`vk^va>u#0!8uM{W)Lg&nIrn(wc{?!DwD_^#3#zeDrfhOyiNR*zW$k}r-gH{ z5&=hM;;A+8TE4^{Wec^^#q6n>Xs7=q_y{lnq%L6Hh}_mS00000NkvXXu0mjfS6i93 literal 0 HcmV?d00001 diff --git a/.themes/classic/source/images/twitter.png b/.themes/classic/source/images/icon/twitter.png similarity index 100% rename from .themes/classic/source/images/twitter.png rename to .themes/classic/source/images/icon/twitter.png diff --git a/_config.yml b/_config.yml index 364bec3..f8437cc 100644 --- a/_config.yml +++ b/_config.yml @@ -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: diff --git a/config.rb b/config.rb index 066427e..f0d44d1 100644 --- a/config.rb +++ b/config.rb @@ -4,6 +4,7 @@ project_type = :stand_alone # Publishing paths http_path = "/" http_images_path = "/images" +http_generated_images_path = "/images" http_fonts_path = "/fonts" css_dir = "public/stylesheets" @@ -11,6 +12,7 @@ css_dir = "public/stylesheets" sass_dir = "sass" images_dir = "source/images" fonts_dir = "source/fonts" +generated_images_dir = "source/images" line_comments = false output_style = :compressed