Skip to content

Commit

Permalink
Facebook try karloespiritu#2.
Browse files Browse the repository at this point in the history
  • Loading branch information
glebius committed Nov 22, 2017
1 parent d32f726 commit 7c7e47b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions _includes/facebook-comments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if site.facebook.app_id %}
<div style="padding-top: 40px; text-align: center; display: block; word-wrap: break-word; -webkit-font-smoothing: antialiased;">
<div>
{% assign canonical_url = page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url %}
<div class="fb-comments" data-href="{{ canonical_url }}" data-numposts="5" width="100%"></div>
</div>
</div>
{% endif %}
8 changes: 8 additions & 0 deletions _includes/facebook-like-post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if site.facebook.app_id %}
<div style="text-align: left; display: block; word-wrap: break-word; -webkit-font-smoothing: antialiased;">
<div>
{% assign canonical_url = page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url %}
<div class="fb-like" data-href="{{ canonical_url }}" data-layout="button_count" data-action="like" data-size="large" data-show-faces="false" data-share="true"></div>
</div>
</div>
{% endif %}
10 changes: 10 additions & 0 deletions _includes/facebook.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% if site.facebook.app_id %}
<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/{{ page-lang-country }}/sdk.js#xfbml=1&version=v2.11&appId={{ site.facebook.app_id }}";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
{% endif %}
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<body>

{% include facebook.html %}
{% include sidebar.html %}

<div class="content container">
Expand Down
2 changes: 2 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<h1 class="post-title">{{ page.title }}</h1>
<span class="post-date">{{ page.date | date_to_string }}</span>
{{ content }}
{% include facebook-like-post.html %}
{% include facebook-comments.html %}
</div>

<div class="related">
Expand Down

0 comments on commit 7c7e47b

Please sign in to comment.