Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add facebook comment #32

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ footer-links:
# Text under the icons in footer
footer-text: © 2017 Kiko Now

# Enter your Disqus shortname (not your username) to enable commenting on posts
# You can find your shortname on the Settings page of your Disqus account
disqus: # <username>.disqus.com
# comment system
comment:
# Enter your Disqus shortname (not your username) to enable commenting on posts
# You can find your shortname on the Settings page of your Disqus account
disqus: # <username>.disqus.com
# Enter your Facebook app_id (not your username) to enable commenting on posts
facebook: # app_id

# Enter your Google Analytics web tracking code (e.g. UA-2110908-2) to activate tracking
google_analytics:
Expand Down
4 changes: 4 additions & 0 deletions _includes/comment.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="comments">
{% include comments/disqus.html %}
{% include comments/facebook.html %}
</div>
15 changes: 15 additions & 0 deletions _includes/comments/disqus.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% if site.comment.disqus %}
<div id="disqus_thread"></div>
<script type="text/javascript">

var disqus_shortname = '{{ site.comment.disqus }}';

(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();

</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{% endif %}
5 changes: 5 additions & 0 deletions _includes/comments/facebook.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% if site.comment.facebook %}
<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src='https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v5.0&appId={{ site.comment.facebook }}&autoLogAppEvents=1'></script>
<div class="fb-comments" data-href="{{ site.url }}{{ page.url }}" data-width="100%" data-numposts="5"></div>
{% endif %}
17 changes: 0 additions & 17 deletions _includes/disqus.html

This file was deleted.

2 changes: 1 addition & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ <h1>{{ page.title }}</h1>
{% endif %}
</div>

{% include disqus.html %}
{% include comment.html %}
</article>