{% extends "with-sidebar.html" %}

{% block title %} - {{ article.title }}{% endblock title %}

{% block head %}
    {{ super() }}

    {% for keyword in article.keywords %}
        <meta name="keywords" contents="{{keyword}}" />
    {% endfor %}

    {% for description in article.description %}
        <meta name="description" contents="{{description}}" />
    {% endfor %}

    {% for tag in article.tags %}
        <meta name="tags" contents="{{tag}}" />
    {% endfor %}
    <meta property="og:type" content="article">
    <meta property="og:title" content="{{ article.title|striptags }}">
    <meta property="og:url" content="{{ article.url }}">
    <meta property="og:description" content="{{ article.summary|striptags|escape }}">
    <meta property="article:published_time" content="{{ article.date|strftime('%A, %B %d, %Y') }}">
    <meta name="twitter:title" content="{{ article.title|striptags }}">
    <meta name="twitter:description" content="{{ article.summary|striptags|escape }}">
    <meta name="description" content="{{ article.summary|striptags|escape }}">
    <meta name="twitter:image" content="{{ article.image }}">
    <meta property="og:image" content="{{ article.image }}">
{% endblock %}

{% block opengraph %}
	{{ super() }}
	<meta property="og:type" content="article">
	<meta property="article:author" content="{{ author }}">
	<meta property="og:url" content="{{ SITEURL }}/{{ article.url }}">
	<meta property="og:title" content="{{ article.title }}">
	<meta property="og:description" content="{{ article.headline }}">
    {% if article.image %}
       <meta property="og:image" content="{{ SITEURL }}/{{ article.image }}">
    {% else %}
	   <meta property="og:image" content="{{ SITEURL }}/images/guilherme-toti.jpg">
    {% endif %}
	<meta property="article:published_time" content="{{ article.date }}">
{% endblock %}

{% block image_header %}
	{% if article.image_header %}
		<img src="{{ article.image_header }}">
	{% elif ARTICLE_PAGE_IMAGE_HEADER %}
		<img src="{{ ARTICLE_PAGE_IMAGE_HEADER }}">
	{% endif %}
{% endblock image_header %}

{% block page_breadcrumbs %}
<li><a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a></li>
<li>{{ article.title }}</li>
{% endblock page_breadcrumbs %}

{% block content %}
<article class="post" style="margin: 0; border: 0;">
	{% if article.image %}
	<figure class="post-img media">
		<div class="mediaholder">
			<a class="mfp-image" title="{{ article.title }}" href="{{ SITEURL }}/{{ article.url }}">
				<img src="{{ SITEURL }}/images/{{ article.image }}" alt=""/>
			</a>
		</div>
	</figure>
	{% endif %}

	<section class="post-content">

		<header class="meta">
			<h2><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></h2>
			<ul>
				<li>By {% for author in article.authors %}<a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>{% if not loop.last %}, {% endif%}{% endfor %}</li>
				<li>{{ article.locale_date }}</li>
				{% if article.modified %}
				    <li>Updated on {{ article.locale_modified }}</li>
				{% endif %}
			</ul>
		</header>

		{{ article.content }}
    {% if article.album %}
        {% for image in article.galleryimages %}
            <div class="gallery">
                <a target="_blak" class="{{ article.album }} cboxElement" href="{{ SITEURL }}/images/gallery/{{ article.album }}/{{ image }}">
                    <img src="{{ SITEURL }}/images/gallery/{{ article.album }}/{{ image }}">
                </a>
            </div>
        {% endfor %}
    {% endif %}
		{% if article.tags %}
		    <div class="tags">
		        <p>tags: {% for tag in article.tags %}<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag | escape }}</a>{% endfor %}</p>
		    </div>
		{% endif %}

		{% include 'sharing.html' %}

		<!--{% if DISQUS_SITENAME and article.status != "draft" %}-->
		    <!--<div class="comments">-->
		        <!--<div id="disqus_thread"></div>-->
		        <!--<script type="text/javascript">-->
		            <!--var disqus_shortname = '{{ DISQUS_SITENAME }}';-->
		            <!--var disqus_identifier = '{{ article.url }}';-->
		            <!--var disqus_url = '{{ DISQUS_SITEURL }}/{{ article.url }}';-->
		            <!--(function() {-->
		                <!--var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;-->
		                <!--dsq.src = 'https://{{ DISQUS_SITENAME }}.disqus.com/embed.js';-->
		                <!--(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);-->
		            <!--})();-->
		        <!--</script>-->
		        <!--<noscript>Please enable JavaScript to view the comments.</noscript>-->
		    <!--</div>-->
		<!--{% endif %}-->
		{% if DISQUS_SITENAME and article.status != 'draft' %}
			<div id="disqus_thread"></div>
				<script>
					
					var disqus_config = function () {
						this.page.url = 'https://{{ DISQUS_SITEURL }}/{{ article.url }}';

						this.page.identifier = '{{ article.url }}'; 
					};
					
					(function() {  // REQUIRED CONFIGURATION VARIABLE: EDIT THE SHORTNAME BELOW
						var d = document, s = d.createElement('script');
						
						s.src = 'https://{{ DISQUS_SITENAME }}.disqus.com/embed.js';
						
						s.setAttribute('data-timestamp', +new Date());
						(d.head || d.body).appendChild(s);
					})();
				</script>
				<noscript>
					Please enable JavaScript to view the 
					<a href="https://disqus.com/?ref_noscript" rel="nofollow">
						comments powered by Disqus.
					</a>
				</noscript>
		{% endif %}
	</section>
	<div class="clearfix"></div>

</article>

{% endblock content %}

{% block pv %}
	{{ super() }} {{ article.pageview }}
{% endblock pv %}
