{% load pages html compress %}

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="description" content="{% block meta_description %}{% meta_description %}{% endblock %}">
        <meta name="robots" content="{% block meta_robots %}{% meta_robots %}{% endblock %}">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
        <link rel="canonical" href="{% canonical_url %}"/>

        <!-- Open Graph data -->
        <meta property="og:title" content="{% block og_title %}{% og_title %}{% endblock %}">
        <meta property="og:url" content="{% canonical_url %}">
        <meta property="og:type" content="website">
        <meta property="og:description" content="{% block og_description %}{% og_description %}{% endblock %}">
        <meta property="og:image" content="{% block og_image %}{% og_image %}{% endblock %}">

        <title>{% block title %}{% title %}{% endblock %}</title>

        {% block feeds %}{% endblock %}

        {% compress css %}
            <link rel="stylesheet" href="/static/css/screen.css"/>
        {% endcompress %}
    </head>

    <body class="{% block body_class %}{% endblock %}">

        {% if settings.GOOGLE_ANALYTICS %}
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          ga('create', '{{ settings.GOOGLE_ANALYTICS }}', 'auto');
          ga('send', 'pageview');

        </script>
        {% endif %}

        {% include 'browser_update.html' %}

        <header>
            <h1><a href="{{pages.homepage.get_absolute_url}}">{{settings.SITE_NAME}}</a></h1>
        </header>

        <nav>
            {% navigation pages.homepage.navigation section=pages.homepage %}
        </nav>

        <div>
            <article>
                {% if not pages.is_homepage %}
                    <nav id="nav-breadcrumbs">{% block breadcrumbs %}{% breadcrumbs %}{% endblock %}</nav>
                {% endif %}
                {% block header_group %}
                    <h1>{% block header %}{% header %}{% endblock %}</h1>
                {% endblock %}
                {% block content_primary %}{{pages.current.content.content_primary|html}}{% endblock %}
            </article>
            <aside>
                {% block content_secondary %}{% endblock %}
            </aside>
        </div>

        <footer>
            <p>© {% now "Y" %} Site owner.</p>
        </footer>

        {% compress js %}
          <script src="/static/js/build/app.js"></script>
        {% endcompress %}

    </body>
</html>
