Skip to content

Instantly share code, notes, and snippets.

@Soldo
Created April 4, 2012 09:38
Show Gist options
  • Save Soldo/2300004 to your computer and use it in GitHub Desktop.
Save Soldo/2300004 to your computer and use it in GitHub Desktop.
open Graph code in <head> section
<head>
...
<meta property="og:title" content="Ovdje-ide-naslov" />
<meta property="og:type" content="sport" />
<meta property="og:url" content="http://kbk-siroki.herokuapp.com/" />
<meta property="og:image" content="http://kbk-siroki.herokuapp.com/assets/kickbox-sb-45f553cf6d712c40eda8b4592b9b014a.jpg" />
<meta property="og:site_name" content="Kickboxing Klub Široki Brijeg" />
<meta property="fb:admins" content="123456789" />
...
</head>
And then inside article like button:
<article>
<div class="fb-like" data-href="http://kbk-siroki.herokuapp.com<%= refinery.blog_post_path %>"
data-send="false" data-layout="box_count" data-width="55" data-show-faces="false"></div>
</article>
I also included this code right after <body> tag:
<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=12345678912345";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment