curiositry/mnml-ghost-theme

Add menu for static pages

Closed this issue · 5 comments

This will arrive by Ghost 0.8, when menus will be supported without hardcoding them in.

Note: I’ve added this experimentally, hardcoded, and you can see it live on http://mnml.herokuapp.com. It should work fine, just update the link list in menu.hbs, and uncomment the partial in default.hbs. I’ll consider it stable when I’ve added it to my main blog.

Hi - This is more than likely a dumb question but what does 'uncomment the partial in default.hbs' mean. I think I have been able to update the links in the menu.hbs file but would be grateful of your help. Sorry - I'm new to all this. Thanks in advance.

@eliotreeves no problem. The menu is in a “handlebars partial” that gets included in the page template. The piece of code that includes the menu is commented out by default, and once you’ve set it up, you need to uncomment it.

On line 54 of default.hbs you should see something like this:
{{!>menu}}

Change that to: {{>menu}} and the menu partial will be activated.

Let me know if you have any other questions or comments, and I’ll do my best to help.

—Omphalosskeptic

(By the way, I’ve just updated the menu.hbs file with a few bugfixes — you could consider grabbing the latest verision while you’re fiddling with it.)

Thanks so much for your help on this. I managed to bring up the menu and re-space the paragraph and remove the indent too. This is great!

One last quick one: I've enabled the comments but they don't seem to appear (like this box). I have to press load more comments before the comments box appear. Is this how it is meant to be?

@eliotreeves At the moment comments should look like this:
screenshot from 2014-10-28 19 39 12

Then, when you push the button, Disqus is loaded:

screenshot from 2014-10-28 19 40 49

My reasons for doing it this way are:

  • Disqus is fairly “heavy”, and slows down the page / uses up bandwidth on mobile.
  • Blog comments don’t always add to the experiece of an article, so I wanted to give readers a chance to decide if they wanted to read them
  • For people who care about it, it means Disqus isn’t tracking them unless they want to view the comments

However, it’s easy to load Disqus automatically. You should be able to replace the contents of partials/comments.hbs with:

  <div id="disqus_thread"></div>
    <script type="text/javascript">
        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
        var disqus_shortname = 'eliotreeves'; // required: replace example with your forum shortname

        /* * * DON'T EDIT BELOW THIS LINE * * */
        (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>

Which is the default Disqus embed, and change the shortname. You should be ready to go!

Let me know if this works out,
Omphalosskeptic