This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def snippet_body | |
@snippet_body ||= Nokogiri( | |
"<html><head></head><body>#{self.body}</body></html>" | |
).text[0..200] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% content_for :meta_ogp do %> | |
<meta property="og:type" content="article"/> | |
<meta property="og:site_name" content="<%= @site.title %>"/> | |
<meta property="og:url" content="<%= base_url + @entry.link %>"/> | |
<meta property="og:title" content="<%= @entry.title %>"/> | |
<meta property="og:description" content="<%= @entry.snippet_body %>"/> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= meta_ogp %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def meta_ogp | |
s = yield_content :meta_ogp | |
s unless s.blank? | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="fb"> | |
<div class="fb-comments" data-href="<%= base_url + @entry.link %>" data-num-posts="5" data-width="690"></div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="fb-comments" data-href="http://example.com" data-num-posts="5" data-width="690"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta property="fb:app_id" content="FACEBOOK_APP_ID" /> | |
<meta property="fb:admins" content="ADMIN_USER_ID" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function($) { | |
var app_id = $('meta[property="fb:app_id"]').attr('content'); | |
$('<script type="text/javascript">') | |
.prop({ async: "true" }) | |
.attr({ src: document.location.protocol + '//connect.facebook.net/ja_JP/all.js' }) | |
.appendTo($('<div>', { id: 'fb-root' }).appendTo($('body'))); | |
window.fbAsyncInit = function() { | |
FB.init({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% content_for :header do %> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript" src="<%= @theme.path %>/js/jquery.facebook.js"></script> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEST |