0

I have re-built my web site using Ocopress. I found it really great for building static site!

BUT the problem now is - that when I try to see in in Internet Explorer 8 - it has a "Mobile" look! I mean - that IE8 is thought to be mobile. And it's not. Al least not for me...

In addition - the "navigate" drop-down has "undefined" entries.

I use IE8 from time to time at my work PC (even though I prefer Firefox and Chrome / Chromium).

See the image I'm attaching - My Octopress site with IE8. [1]

Compare to how my Octopress site looks in Firefox (looks good!): [2]

Compare it to how my Octopress site looks in Google Chrome (also good!)

  1. My site on IE8 (not good):
    http://www.flickr.com/photos/meorero/8657827234/

  2. Firefox (good): http://www.flickr.com/photos/meorero/8656722709/

Oren Maurer
  • 179
  • 2
  • 6
  • Not really enough information here for us to help. We at least need to see your site or an example of what's going wrong. – Spudley Apr 17 '13 at 09:16
  • Hi @Spudley . My web site is: http://www.meorero.org.il . I have also tried to ass into my question links to screenshots that I uploaded to Flickr - see above. Thanks. – Oren Maurer Apr 17 '13 at 10:13

2 Answers2

1

There's a few issues going on here in <= ie8 as I found with my octopress site.

(I'm using Octopress v2.0 as cloned from the master branch on March-11-2013)

  • the site uses html5 tags
  • the upgrade to Modernizr 2.6 drops respond.js which means the site always looks like the mobile version
  • and the navigate dropdown labels don't work in any ie versions

So, The following worked for me on my site:

  1. Add

    <!--[if lt IE 9]>
        <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <script src="{{ root_url }}/javascripts/libs/respond.min.js"></script>
    <![endif]-->
    

    to source/_includes/head.html before the </head> tag

  2. Get the respond.min.js file

    git clone https://github.com/scottjehl/Respond.git

    and put it in source/javascripts/libs

This should fix the styling and media query problem for <= ie8

  1. To fix the navigate drop down will need to fix the use of link.text attribute in octopress.js. The version of octopress I cloned includes jquery so:

    in source/javascripts/octopress.js make the changes to getNav() as indicated below, replacing link.text with $(link).text() as IE uses innerText rather than text attribute on the links.

    Heres the change set diff:

    @@ -3,10 +3,10 @@
       mobileNav.children('select').append('<option value="">Navigate&hellip;</option>');
       $('ul[role=main-navigation]').addClass('main-navigation');
       $('ul.main-navigation a').each(function(i, link) {
    -    mobileNav.children('select').append('<option value="'+link.href+'">&raquo; '+link.text+'</option>');
    +    mobileNav.children('select').append('<option value="'+link.href+'">&raquo; '+$(link).text()+'</option>');
       });
       $('ul.subscription a').each(function(i, link) {
    -    mobileNav.children('select').append('<option value="'+link.href+'">&raquo; '+link.text+'</option>');
    +    mobileNav.children('select').append('<option value="'+link.href+'">&raquo; '+$(link).text()+'</option>');
       });
       mobileNav.children('select').bind('change', function(event) {
         if (event.target.value) { window.location.href = event.target.value; }
    

The octopress issue tracking is closed on github for the moment so some or all of these things will hopefully be fixed by the next release.

christl11
  • 11
  • 2
  • Champion. This was exactly what I was looking for. The `octopress.js` file is slightly different in 2.1, but the change you described did the trick. Thanks! – alexwlchan Jun 10 '13 at 10:55
0

Here is what I did - this seems to work for Desktop browsers - including IE8 !!:

In ./source/_includes/head.html

Deleted this:

<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en">
<!--<![endif]-->
<head>

And put this:

<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
Oren Maurer
  • 179
  • 2
  • 6
  • Well... I try to re-open this post. At home PC with IE9 - my site looks OK. BUT at my work PC - with IE8 - the site still looks bad, and quite broken , so... the above did not really help :-( – Oren Maurer Apr 22 '13 at 04:59