ouija-io / ouija

Communicating with ghosts
http://ouija.io
BSD 3-Clause "New" or "Revised" License
128 stars 14 forks source link

Installation doesn't work on all themes? #67

Closed ghost closed 10 years ago

ghost commented 10 years ago

I've gone through the quick install on my Ghost blog and it doesn't seem to be working. I even went as far as creating a new GoInstant app but it still refuses to appear. I'm using the Ghostium theme which has Disqus built in, wondering if that is causing a conflict? Below is the contents of my default.hbs

http://pastebin.com/Xy428tW0

Any help would be grealy appreciated!

mattcreager commented 10 years ago

Is the blog live anywhere? Oh Ghostium is OS, I'll tinker with this in the morning, thanks!

ghost commented 10 years ago

Sorry the blog is here: www.beeped.org

mattcreager commented 10 years ago

That helped, Disqus is throwing an error: GET http://.disqus.com/embed.js net::ERR_NAME_NOT_RESOLVED

Which is being added to the DOM in this block, starting on line 92:

 if(GHOSTIUM.haveDisqus) {
        (function () {
        var s = document.createElement('script'); s.async = true;
        s.type = 'text/javascript';
        s.src = '//' + disqus_shortname + '.disqus.com/count.js'; // right here.
        (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
        }());
      }

Because GHOSTIUM.haveDisqus is being evaluated as true here, on line 54:

      // Ghostium Globals
      // ==============
      window.GHOSTIUM = {};
      GHOSTIUM.haveGA = typeof ga_ua !== 'undefined' && ga_ua !== 'UA-XXXXX-X';
      GHOSTIUM.haveDisqus = typeof disqus_shortname !== 'undefined' && disqus_shortname !== 'example';
      GHOSTIUM.enablePjax = typeof enable_pjax !== 'undefined' ? enable_pjax : true;

If you view-source on beeped.org you can see that disqus_shortname is set to an empty string on line 53. So it is neither undefined, or equal to 'example'

That partial is being added to the page here, on line 38:

<script type="text/javascript">
      {{> custom/config}}

      // Pace Options
      // ==============

You can find that partial in /ghostium/partials/custom/config.hbs. Just provide a new disqus_shortname, remove the line entirely or set it to 'example'

Hope this helps :)

ghost commented 10 years ago

I removed the Disqus references from default.hbs as well as from config.hbs but it still doesn't appear to be loading. Thoughts?

mattcreager commented 10 years ago

Ah, ok easy fix @8bitogre:

Ouija provides some custom configuration options, you need to add one for the Ghostium theme.

 {{#with post}}
      <script>
        window.ouija_connect_url = 'https://goinstant.net/YourAccount/YourConnectUrl';
        window.ouija_identifier = {{ id }};
        window.ouija_article_content = '.post-body';
      </script>
      ...
ghost commented 10 years ago

That worked. Thank you!

mattcreager commented 10 years ago

@8bitogre I suspect you might run into issues later with the async post loads. Let's tackle that in another issue :)

Kikobeats commented 10 years ago

@mattcreager Same problem with other custom theme here. In local with Casper works fine, but not with my theme (Uno)

In Uno ouija_article_content is like Ghost. Why don't work? :-(

the blog: www.kikobeats.com

colinmacdonald commented 10 years ago

The Uno theme is slightly different from Casper in where it defines the section for the post's content. The selector in Uno is section.post rather than the default section.post-content. Try adding this line in default.hbs just under window.ouija_identifier = {{id}};:

window.ouija_article_content = 'section.post';
Kikobeats commented 10 years ago

Oh, thanks man. Maybe the problem is that I'm very newbie with Ghost :-|

Bonus question, I'm setting up login with Twitter and Github, but Github don't appear...

You can see in live now!

colinmacdonald commented 10 years ago

We don't currently support any other auth providers, only Twitter. There is an issue open for this: #39.

Kikobeats commented 10 years ago

ok, I supposed. Thanks for all, I want try to help :-)

ntassone commented 10 years ago

@Kikobeats some themes will require a little bit of custom css to make ouija fully compatible. In the case of the Uno theme you'll have to add a rule that changes the value of the offset that pushes the article to make room for ouija.

Try adding this to your CSS, it will make the post content move farther and not cut off ouija on the right side of the screen:

.post-ouija.ouija-active {
  right: 335px;
}

I edited your site in the inspector and got it working by adding the above:

uno

Kikobeats commented 10 years ago

@ntassone

Thanks for the tip. Maybe for my theme layout can be better right: 0px;. I'm going to try different things.

I need to improve to be more readable in my theme :-)