Skip to content

Commit

Permalink
add fb comment
Browse files Browse the repository at this point in the history
  • Loading branch information
npes87184 committed Apr 24, 2018
1 parent c3ba562 commit 09284c0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ url-pretty: "MyWebsite.com" # eg. "deanattali.com/beautiful-jekyll"
# Fill in your Disqus shortname (NOT the userid) if you want to support Disqus comments
#disqus: ""

# Use Facebook Comments Plugin by assigning Facebook comment app id here.
# fb_comment_id: ""

# Facebook App ID
# fb_app_id: ""

Expand Down
14 changes: 14 additions & 0 deletions _includes/fb-comment.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{%- if site.fb_comment_id -%}
<div class="comments">
<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 = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.12&appId={{ site.fb_comment_id }}&autoLogAppEvents=1';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="{{ site.url }}{{ page.url }}" data-width="100%" data-numposts="5"></div>
<noscript>Please enable JavaScript to view the comments powered by Facebook.</noscript>
</div>
{%- endif -%}
1 change: 1 addition & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<div class="disqus-comments">
{% include disqus.html %}
</div>
{% include fb-comment.html %}
{% endif %}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<div class="disqus-comments">
{% include disqus.html %}
</div>
{% include fb-comment.html %}
{% endif %}
</div>
</div>
Expand Down

0 comments on commit 09284c0

Please sign in to comment.