<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->
<html lang="en"> <!--<![endif]-->
<head>
    <meta charset="utf-8"/>

    <!-- Set the viewport width to device width for mobile -->
    <meta name="viewport" content="width=device-width"/>

    <title>{% block site_title %}{{ settings.SITE_TITLE }}{% endblock %}</title>

    {#    {% if meta_description %}#}
    {#        <meta name="description" content="{{ engineer.meta_description }}">#}
    {#    {% endif %}#}
    {##}
    {% if meta_author %}
        <meta name="author"
              content="{% block meta_author %}{{ settings.SITE_AUTHOR }}{% endblock %}">
    {% endif %}

    <link rel="alternate" type="application/rss+xml"
          title="{{ settings.SITE_TITLE }} RSS Feed"
          href="{{ urlname('feed') }}"/>

    {% block foundationcss %}
        {% if theme.use_foundation %}
            {% filter compress %}
                {# FOUNDATION CSS #}
                <link rel="stylesheet"
                      href="{{ settings.ENGINEER.FOUNDATION_CSS_URL }}stylesheets/grid.css">
                <link rel="stylesheet"
                      href="{{ settings.ENGINEER.FOUNDATION_CSS_URL }}stylesheets/mobile.css">

                <!--[if lt IE 9]>
                    <link rel="stylesheet" href="{{ settings.ENGINEER.FOUNDATION_CSS_URL }}stylesheets/ie.css">
                <![endif]-->
            {% endfilter %}
        {% endif %}
    {% endblock %}

    {% block stylesheets %}{% endblock %}
    {% block stylesheets_include %}
        {% include ['_stylesheets.html', 'theme/_stylesheets.html'] ignore missing %}
    {% endblock %}

    {% block lesscss %}
        {% if theme.use_lesscss %}
            {% if not settings.PREPROCESS_LESS %}
                <script src="{{ settings.ENGINEER.LESS_JS_URL }}"
                        type="text/javascript">
                </script>
                {% if DEBUG %}
                    <script type="text/javascript">
                        //less = { env:'development' };
                        less.watch();
                    </script>
                {% endif %}
            {% endif %}
        {% endif %}
    {% endblock %}

    {% block scripts_top %}{% endblock %}
    {% block scripts_top_include %}
        {% include ['_scripts_top.html', 'theme/_scripts_top.html'] ignore missing %}
    {% endblock %}

    {% block modernizr %}
        {% if theme.use_modernizr %}
            <script src="{{ settings.ENGINEER.MODERNIZR_URL }}"
                    type="text/javascript"></script>
        {% endif %}
    {% endblock %}

    {% block jquery %}
        {% if theme.use_jquery -%}
            <!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
            <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
            <script>
                window.jQuery || document.write('<script src="{{ settings.ENGINEER.JQUERY_URL }}"><\/script>')
            </script>
        {%- endif %}
    {% endblock %}

    {% block twitter %}
        {% if theme.twitter_id %}
            {% filter compress %}
                <script type="text/javascript" src="{{ settings.ENGINEER.TWEET_URL }}"></script>
                <script type='text/javascript'>
                    jQuery(function ($) {
                        $(".tweet").tweet({
                            username:'{{ theme.twitter_id }}',
                            join_text:null,
                            avatar_size:null,
                            retweets:false,
                            count:{{ theme.tweet_count if theme.tweet_count else 5 }},
                            loading_text:"loading tweets...",
                            template:"{text}{time}"
                        });
                    });
                </script>
            {% endfilter %}
        {% endif %}
    {% endblock %}

    <!-- IE Fix for HTML5 Tags -->
    <!--[if lt IE 9]>
		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
</head>
<body class="{%- block body_class %}{% endblock -%}">
{%- block body %}{% endblock -%}

{% block foundation_js %}
    {% if theme.use_foundation -%}
        {% filter compress %}
            <script src="{{ settings.ENGINEER.FOUNDATION_CSS_URL }}javascripts/foundation.js"></script>
        {% endfilter %}
    {%- endif %}
{% endblock %}

{% block scripts_bottom %}{% endblock %}
{% block scripts_bottom_include %}
    {% include ['_scripts_bottom.html', 'theme/_scripts_bottom.html'] ignore missing %}
{% endblock %}

</body>
</html>
