add fb comment (#350)

* add fb comment

* Update README.md for facebook comments

* Update _config.yml

* Update README.md
This commit is contained in:
npes87184 2018-06-09 06:25:07 +08:00 committed by Dean Attali
parent 786849a7c2
commit b9a562da4f
5 changed files with 30 additions and 4 deletions

14
_includes/fb-comment.html Normal file
View file

@ -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 -%}