Skip to content

Instantly share code, notes, and snippets.

@tyaslab
Created February 25, 2016 09:55
Show Gist options
  • Save tyaslab/c4a099ddce38e1b79367 to your computer and use it in GitHub Desktop.
Save tyaslab/c4a099ddce38e1b79367 to your computer and use it in GitHub Desktop.
Share Button
<div class="sharer">
<a href="http://www.facebook.com/sharer.php?u={{ url_scheme }}://{{ current_site }}{{ object.get_absolute_url() }}" target="_blank" class="button sharer-button"><i class="fa fa-facebook"></i> Facebook</a>
<a href="https://twitter.com/intent/tweet?text={{ object.title }}&url={{ url_scheme }}://{{ current_site }}{{ object.get_absolute_url() }}&via=tyaslab" target="_blank" class="button sharer-button"><i class="fa fa-twitter"></i> Twitter</a>
<a href="https://plus.google.com/share?url={{ url_scheme }}://{{ current_site }}{{ object.get_absolute_url() }}" target="_blank" class="button sharer-button"><i class="fa fa-google-plus"></i> Google Plus</a>
</div>
<script>
$('a.sharer-button').on('click', function() {
var href = $(this).attr('href');
window.open(href, 'sharer', 'width=600,height=300');
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment