<!DOCTYPE html>
<html lang="{% block html_lang %}{{ DEFAULT_LANG }}{% endblock html_lang %}">
<head>
  {% block head %}
  <title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
  {% if FAVICON %}
  <link rel="icon" type="image/x-icon" href="{{ SITEURL }}/{{ FAVICON }}">
  {% endif %}
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
  <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/{{ CSS_FILE }}" />
  {% if THEME_COLOUR == 1 %}
  <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css-include/colour-blue.css" />
  {% elif THEME_COLOUR == 0 %}
  <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css-include/colour-default.css" />  
  {% else %}
  <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css-include/colour-default.css" />  
  {% endif %}
  {% if (article and article.photo_gallery) or (articles_page and articles_page.object_list[0].photo_gallery) %}
	<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/magnific-popup.css">
  {% endif %}  
  <meta name="generator" content="Pelican" />
  {% if FEED_ALL_ATOM %}
  <link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
  {% endif %}
  {% if FEED_ALL_RSS %}
  <link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Full RSS Feed" />
  {% endif %}
  {% if FEED_ATOM %}
  <link href="{{ FEED_DOMAIN }}/{%if FEED_ATOM_URL %}{{ FEED_ATOM_URL }}{% else %}{{ FEED_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
  {% endif %}
  {% if FEED_RSS %}
  <link href="{{ FEED_DOMAIN }}/{% if FEED_RSS_URL %}{{ FEED_RSS_URL }}{% else %}{{ FEED_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
  {% endif %}
  {% if CATEGORY_FEED_ATOM and category %}
  <link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_ATOM_URL %}{{ CATEGORY_FEED_ATOM_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_ATOM.format(slug=category.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
  {% endif %}
  {% if CATEGORY_FEED_RSS and category %}
  <link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_RSS_URL %}{{ CATEGORY_FEED_RSS_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_RSS.format(slug=category.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
  {% endif %}
  {% if TAG_FEED_ATOM and tag %}
  <link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_ATOM_URL %}{{ TAG_FEED_ATOM_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_ATOM.format(slug=tag.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
  {% endif %}
  {% if TAG_FEED_RSS and tag %}
  <link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_RSS_URL %}{{ TAG_FEED_RSS_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_RSS.format(slug=tag.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
  {% endif %}

  {% if TRACKING == True %}
  {% include 'include/trackingcode.html' %}
  {% endif %}

  {% endblock head %}
  {% block somemorehead %}
  {% endblock somemorehead %}

  {% if USE_LIGHTBOX == True %}
  {% if (article and article.photo_gallery) or (articles_page and articles_page.object_list[0].photo_gallery) %}
	<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css-include/magnific-popup.css">
  {% endif %}
  {% endif %}
</head>
<body class="is-preload">
  <div id="wrapper">
    <div id="main">
      <div class="inner">
        <!-- Header -->
        <header id="header">
          <strong><a href="{{ SITEURL }}/" class="logo">{{ SITENAME }}{% if SITESUBTITLE %} {{ SITESUBTITLE }}{% endif %}</a></strong>
          <ul class="icons">
            {% if SOCIAL_TWITTER %}
              <li><a href="https://twitter.com/{{ SOCIAL_TWITTER }}" class="icon brands fa-twitter" target="_blank" rel="noopener noreferrer"><span class="label">Twitter</span></a></li>
            {% endif %}
            {% if SOCIAL_MASTODON %}
            <li><a href="{{ SOCIAL_MASTODON }}" class="icon brands fa-mastodon" target="_blank" rel="noopener noreferrer"><span class="label">Mastodon</span></a></li>
            {% endif %}
            {% if SOCIAL_FLICKR %}
              <li><a href="https://www.flickr.com/photos/{{ SOCIAL_FLICKR }}" class="icon brands fa-flickr" target="_blank" rel="noopener noreferrer"><span class="label">Flickr</span></a></li>
            {% endif %}
            {% if SOCIAL_GITHUB %}
              <li><a href="https://github.com/{{ SOCIAL_GITHUB }}" class="icon brands fa-github" target="_blank" rel="noopener noreferrer"><span class="label">Github</span></a></li>
            {% endif %}
            {% if SOCIAL_LINKEDIN %}
              <li><a href="https://www.linkedin.com/in/{{ SOCIAL_LINKEDIN }}" class="icon brands fa-linkedin" target="_blank" rel="noopener noreferrer"><span class="label">LinkedIn</span></a></li>
            {% endif %}
            {% if SOCIAL_YOUTUBE %}
            <li><a href="https://www.youtube.com/channel/{{ SOCIAL_YOUTUBE }}" class="icon brands fa-youtube" target="_blank" rel="noopener noreferrer"><span class="label">LinkedIn</span></a></li>
            {% endif %}

            {% if FEED_ALL_ATOM %}
            <li><a href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" class="icon brands fa-atom"><span class="label">atom feed</span></a></li>
            {% endif %}
            {% if FEED_ALL_RSS %}
            <li><a href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" class="icon brands fa-rss"><span class="label">rss feed</span></a></li>
            {% endif %}  
          </ul>
        </header>

        <section>
            {% block content %}
            {% endblock %}
        </section>


      </div>

    </div>
    {% include 'include/sidebar.html' %}
  </div>

  <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/jquery.min.js"></script>
  <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/browser.min.js"></script>
  <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/breakpoints.min.js"></script>
  <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/util.js"></script>
  <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/main.js"></script>

{% if IMAGETRACKINGCODE %}
{{ IMAGETRACKINGCODE }}
{% endif %}

{% if USE_LIGHTBOX == True %}
{% if (article and article.photo_gallery) or (articles_page and articles_page.object_list[0].photo_gallery) %}
<!-- jQuery 1.7.2+ or Zepto.js 1.0+ -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

<!-- Magnific Popup core JS file -->
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/magnific-popup.js"></script>
<script>
$('.gallery').magnificPopup({
	delegate: 'a',
	type: 'image',
	gallery: {
		enabled: true,
		navigateByImgClick: true,
		preload: [1,2]
	},
	image: {
		titleSrc: function(item) {
			if (item.el.attr('caption') && item.el.attr('exif')) {
				return (item.el.attr('caption').replace(/\\n/g, '<br />') +
					'<small>' + item.el.attr('title') + ' - ' + item.el.attr('exif') + '</small>');
			}
		return item.el.attr('title') + '<small>' + item.el.attr('exif') + '</small>';
	} }
});
</script>
{% endif %}
{% endif %}
</body>
</html>
