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

Disqus not working correctly #13

Open
nectarine opened this issue Jun 10, 2014 · 5 comments
Open

Disqus not working correctly #13

nectarine opened this issue Jun 10, 2014 · 5 comments

Comments

@nectarine
Copy link

The main problem is every post has same disqus, because var disqus_identifier not set correctly.

var disqus_identifier would be dynamically set by ghostion.min.js.
However, ghostion.min.js is served as static resource, so var disqus_identifier will not be updated due to 304 response(not modified).

Javascript variable style is your intended structure, so I don't want to make a pull request with my style(function parameter style).

With function parameter, I avoid this with

<!-- ghostion/partials/widgets/at_disqus.hbs -->
<div id="at_disqus">
    <div id="disqus_thread">
                <a class="button small radius" href="#" onclick="atPost.loadDisqus('{{post.id}}');return false;"><span class="fa fa-comments"></span> Discuss</a>
    </div>
</div>
// ghostion/assets/js/ghostion.min.js
var atPost=atPost||{};atPost.loadDisqus=function(post_id){var disqus_identifier=post_id;e=document.createElem...
@jimbobbennett
Copy link

It's not pretty, but it works for me. Thanks for the solution!

@jimbobbennett
Copy link

Thanks for the fix - I've implemented it into my version of Ghostion.

https://github.com/jimbobbennett/FauxGhost

@imjohnbo
Copy link

I'm encountering post.id as an empty variable, so '' is sent to atPost.loadDisqus() each time. Any ideas?

console_ghost

@nectarine
Copy link
Author

Did you update ghostion/partials/widgets/at_disqus.hbs?
Besides, this is a quite old issue, so Ghost itself could be updated.
Note that Ghost is now over 1.0, and ghostion is compatible with 0.4.
This hack could not be worked.

@imjohnbo
Copy link

Thanks, but I determined the fix. For Ghost 0.5.8 (current), change ghostion.min.js as @nectarine recommends, and change at_disqus.hbs to be the following:

<!-- ghostion/partials/widgets/at_disqus.hbs -->
<div id="at_disqus">
    <div id="disqus_thread">
                <a class="button small radius" href="#" onclick="atPost.loadDisqus({{id}});return false;"><span class="fa fa-comments"></span> Discuss</a>
    </div>
</div>

fauxcult pushed a commit to fauxcult/ghostion that referenced this issue Mar 19, 2015
fauxcult pushed a commit to fauxcult/ghostion that referenced this issue Mar 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants