mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-12-24 08:28:50 -05:00
Added support for using text based social sharing links instead of javascript widgets which may track users and do trigger crazy high http requests. Also added a custom sharing template file for injecting any other sharing widget into the sharing section after a post
This commit is contained in:
parent
f180feb402
commit
8cb79404d5
@ -62,9 +62,10 @@ $page-border-bottom: darken($footer-bg, 5) !default;
|
||||
/* Core theme application */
|
||||
|
||||
a {
|
||||
color: $link-color;
|
||||
@include link-colors($link-color, $hover: $link-color-hover, $focus: $link-color-hover, $visited: $link-color-visited, $active: $link-color-active);
|
||||
}
|
||||
aside.sidebar a {
|
||||
.sidebar a {
|
||||
@include link-colors($sidebar-link-color, $hover: $sidebar-link-color-hover, $focus: $sidebar-link-color-hover, $active: $sidebar-link-color-active);
|
||||
}
|
||||
a {
|
||||
|
@ -19,7 +19,7 @@ article {
|
||||
}
|
||||
.blog-index & { background: none; padding-bottom: 0; }
|
||||
p {
|
||||
font-size: .9em;
|
||||
font-size: .8em;
|
||||
margin: 0;
|
||||
color: $text-color-light;
|
||||
&.meta { @extend .sans; position: absolute; top: 0; }
|
||||
|
@ -1,3 +1,37 @@
|
||||
@mixin social-button-bg($img, $color: #444) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
.simple-social-button {
|
||||
display: inline-block;
|
||||
border: 1px solid #ccc;
|
||||
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);
|
||||
}
|
||||
|
||||
.sharing {
|
||||
p.meta + & {
|
||||
padding: { top: 1em; left: 0; }
|
||||
@ -6,3 +40,16 @@
|
||||
}
|
||||
|
||||
#fb-root { display: none; }
|
||||
|
||||
.googleplus-share {
|
||||
@extend .simple-social-button;
|
||||
@include social-button-bg('googleplus.png', #db583b);
|
||||
}
|
||||
.facebook-share {
|
||||
@extend .simple-social-button;
|
||||
@include social-button-bg('facebook.png', #4e5a9b);
|
||||
}
|
||||
.twitter-share, .sidebar a.twitter-follow-button {
|
||||
@extend .simple-social-button;
|
||||
@include social-button-bg('twitter.png');
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
.side-shadow-border {
|
||||
@include box-shadow(lighten($sidebar-bg, 5) 0 1px);
|
||||
}
|
||||
aside.sidebar {
|
||||
.sidebar {
|
||||
overflow: hidden;
|
||||
color: $sidebar-color;
|
||||
text-shadow: lighten($sidebar-bg, 8) 0 1px;
|
||||
@ -44,7 +44,7 @@ aside.sidebar {
|
||||
color: inherit;
|
||||
@include transition(color .5s);
|
||||
}
|
||||
&:hover a {
|
||||
&:hover p a, &:hover li a {
|
||||
color: $sidebar-link-color;
|
||||
&:hover { color: $sidebar-link-color-hover; }
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
{% include disqus.html %}
|
||||
{% unless site.do_not_track %}
|
||||
{% include facebook_like.html %}
|
||||
{% include google_plus_one.html %}
|
||||
{% include twitter_sharing.html %}
|
||||
{% endunless %}
|
||||
{% include custom/after_footer.html %}
|
||||
|
3
.themes/classic/source/_includes/custom/sharing.html
Normal file
3
.themes/classic/source/_includes/custom/sharing.html
Normal file
@ -0,0 +1,3 @@
|
||||
{% comment %}
|
||||
You can add sharing buttons here. Just so you know, some services may use these buttons to track visitors to your site, and also these can trigger lots of http requests slowing your site down for low bandwidth and mobile users.
|
||||
{% endcomment %}
|
@ -1,6 +1,6 @@
|
||||
{% if site.facebook_like %}
|
||||
<div id="fb-root"></div>
|
||||
<script>(function(d, s, id) {
|
||||
<script type="text/javascript">(function(d, s, id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) {return;}
|
||||
js = d.createElement(s); js.id = id;
|
||||
|
@ -1,11 +1,24 @@
|
||||
<div class="sharing">
|
||||
{% if site.twitter_tweet_button %}
|
||||
<a href="http://twitter.com/share" class="twitter-share-button" data-url="{{ site.url }}{{ page.url }}" data-via="{{ site.twitter_user }}" data-counturl="{{ site.url }}{{ page.url }}" >Tweet</a>
|
||||
{% if site.do_not_track %}
|
||||
<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>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if site.google_plus_one %}
|
||||
{% if site.do_not_track %}
|
||||
<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 %}
|
||||
<a title="Share on Facebook" class="facebook-share" href="http://www.facebook.com/sharer.php?s=100&p[url]={{site.url}}{{page.url}}" target="_blank">Share</a>
|
||||
{% else %}
|
||||
<div class="fb-like" data-send="true" data-width="450" data-show-faces="false"></div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% include custom/sharing.html %}
|
||||
</div>
|
||||
|
BIN
.themes/classic/source/images/facebook.png
Normal file
BIN
.themes/classic/source/images/facebook.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 209 B |
BIN
.themes/classic/source/images/googleplus.png
Normal file
BIN
.themes/classic/source/images/googleplus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 365 B |
BIN
.themes/classic/source/images/twitter.png
Normal file
BIN
.themes/classic/source/images/twitter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 302 B |
@ -42,8 +42,8 @@ pagination_dir: blog # Directory base for pagination URLs eg. /blog/page/2/
|
||||
recent_posts: 5 # Posts in the sidebar Recent Posts section
|
||||
excerpt_link: "Read on →" # "Continue reading" link text at the bottom of excerpted articles
|
||||
excerpt_in_feed: false # Truncate excerpted articles in the atom feed
|
||||
permalink_label: "∞"
|
||||
permalink_label_feed: "∞ Permalink"
|
||||
permalink_label: "Permalink"
|
||||
permalink_label_feed: "⚓ Permalink"
|
||||
linklog_marker: "→"
|
||||
linklog_marker_position: after
|
||||
linklog_marker_position_feed: after
|
||||
@ -65,6 +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
|
||||
|
||||
# Github repositories
|
||||
github_user:
|
||||
github_repo_count: 0
|
||||
|
Loading…
Reference in New Issue
Block a user