{% extends 'layout.html' %}
{% block meta %}
<meta name="description" content="{{post.description}}">
<meta name="keywords" content="{{post.keywords}}">
{% endblock %}
{% block title %}{{post.title}}{% endblock %}
{% block content %}

<script>
var tocOpen = true;
function toggleToc() { 
    if(tocOpen) { 
        hideToc();
    } else { 
        showToc();
    }
    return false;
}
function showToc() { 
    $(".toc").show();
    $(".toc-control").removeClass("toc-control-closed");
    $(".toc-control").addClass("toc-control-open");
    tocOpen = true;
}
function hideToc() { 
    $(".toc").hide();
    $(".toc-control").removeClass("toc-control-open");
    $(".toc-control").addClass("toc-control-closed");
    tocOpen = false;
}
</script>

<div class="post-wrap">

{{conf.style_post}}

{% if post.toc %}
<div class="post-toc">
  {{post.toc}}
  <div class="toc-control toc-control-open">
      <a href="#" onclick="return toggleToc();"><b class="fontawesome-th-list"></b></a>
  </div>
</div>
{% endif %}

{% if post.toc %}<div class="post-content-toc">{% endif %}
<div class="post-content">
<div class="post">

{% if not post.hide_author %}
<div class="post-author-block">
  Posted on <strong>{{post.mtimestamp}}</strong> by <strong>{{post.author}}</strong>
</div>
{% endif %}

<div class="post-tags">
  {% for t in post.tags %}
    <a class="tag"
        href="{{conf.web_prefix}}/{{conf.search_tpl}}?t={{t}}">{{t}} <span class="fontawesome-tag"></span></a>
  {% endfor %}
  <div class="clear"></div>
</div>

{{post.target_text|safe}}

{% if sopt.disqus_shortname %}
<div id="comments">
  <div id="disqus_thread"></div>
    <script type="text/javascript">
        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
        var disqus_shortname = '{{sopt.disqus_shortname}}';

        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    </script>
</div>
{% endif %}
</div><!-- end post -->
</div><!-- end post-content -->
{% if post.toc %}</div><!-- end post-content-toc -->{% endif %}
</div><!-- end post-wrap -->
{% endblock %}
