Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

"Facebook Comments" do not work for single posts. #86

Closed
FlorianWolters opened this issue May 13, 2012 · 4 comments
Closed

"Facebook Comments" do not work for single posts. #86

FlorianWolters opened this issue May 13, 2012 · 4 comments
Assignees
Labels
Milestone

Comments

@FlorianWolters
Copy link

Hi,

I just discovered that the way "Facebook Comments" are included only works for the entire site and not for every single post.

The file _includes/JB/comments-providers/facebook has to be changed to the following to fix this issue:

<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/en_US/all.js#xfbml=1&appId={{ site.JB.comments.facebook.appid }}";
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-comments" data-href="{{ site.production_url }}{{ page.url }}" data-num-posts="{{ site.JB.comments.facebook.num_posts }}" data-width="{{ site.JB.comments.facebook.width }}" data-colorscheme="{{ site.JB.comments.facebook.colorscheme }}"></div>

I only changed data-href="{{ site.production_url }}" to data-href="{{ site.production_url }}{{ page.url }}".

@alishutc
Copy link
Contributor

I just discovered this too. Happy to create a PR to fix this.

@groundh0g
Copy link
Collaborator

Thanks for the info. Can't believe it hasn't been patched yet. Your fix worked great for me.

@groundh0g groundh0g self-assigned this Feb 28, 2015
@groundh0g groundh0g added the bug label Feb 28, 2015
@groundh0g
Copy link
Collaborator

@FlorianWolters's fix 0f60744 needs to be made in the official repo. I won't add all the formatting changes, just the edit to the existing line ...

// in file: jekyll-bootstrap/_includes/JB/comments-providers/facebook
<div class="fb-comments" data-href="{{ site.production_url }}" data-num-posts="...

... to read as follows.

<div class="fb-comments" data-href="{{ site.production_url }}{{ page.url }}" data-num-posts="...

plusjade added a commit that referenced this issue Feb 28, 2015
@groundh0g
Copy link
Collaborator

Looks like this is fixed in master. Closing. If you're still having issues, feel free to reopen.

@groundh0g groundh0g added this to the v 0.4.0 milestone Mar 15, 2015
aterai pushed a commit to aterai/jekyll-bootstrap that referenced this issue Mar 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants