Skip to content

Instantly share code, notes, and snippets.

@modmedia
Created January 18, 2014 22:10
Show Gist options
  • Save modmedia/8497442 to your computer and use it in GitHub Desktop.
Save modmedia/8497442 to your computer and use it in GitHub Desktop.
Add social icons to Mura pages
<!--- Add to the top of your page body in the template --->
<!--- Facebook Share Script --->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js##xfbml=1&appId=xxxxxxxxxxxxx";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script><!--- End Facebook Share Script --->
<div id="shareLinks">
<!--- Facebook Button --->
<div class="fb-like" data-href="#$.getCurrentURL()#" data-send="true" data-layout="button_count" data-width="450" data-show-faces="false">
</div>
<!--- Twitter Button: Change "data-via:twitterHandle" to your own Twitter handle --->
<div id="twitterShare">
<a href="https://twitter.com/share" class="twitter-share-button" data-via="twitterHandle">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<!--- Linked In Button --->
<div id="linkedInShare">
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-counter="right"></script>
</div>
<!--- Google +1 --->
<div id="googleShare">
<div class="g-plus" data-action="share" data-annotation="bubble">
</div>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment