{% extends 'base.html' %}

{% block title %}
Search · {{ super() }}
{% endblock title %}

{% block head_description %}
Search results for {{ SITENAME|striptags|e }} blog.
{% endblock head_description %}

{% block meta_tags_in_head %}
{{ super() }}
<meta property="og:title" content="Search · {{ SITENAME|striptags|e }}"/>
<meta name="twitter:title" content="Search · {{ SITENAME|striptags|e }}">
<meta property="og:url" content="{{ SITEURL }}/search.html" />
<meta property="og:description" content="Search results for {{ SITENAME|striptags|e }} blog" />
<meta name="twitter:description" content="Search results for {{ SITENAME|striptags|e }} blog">
<meta property="og:site_name" content="{{ SITENAME|striptags|e }}" />
<meta property="og:article:author" content="{{ AUTHOR }}" />
{% from '_includes/_defaults.html' import FEATURED_IMAGE with context %}
{% if FEATURED_IMAGE %}
<meta property="og:image" content="{{FEATURED_IMAGE}}" />
<meta name="twitter:image" content="{{FEATURED_IMAGE}}" >
{% endif %}
{% endblock meta_tags_in_head %}

{% block script %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
    {% if 'assets' in PLUGINS %}
    {% include '_includes/minify_tipuesearch.html' with context %}
    {% else %}
<script type="text/javascript" src="{{ SITEURL }}/theme/tipuesearch/tipuesearch_set.js"></script>
<script type="text/javascript" src="{{ SITEURL }}/theme/tipuesearch/tipuesearch.min.js"></script>
    {% endif %}
<script>
$(document).ready(function() {
     $('#tipue_search_input').tipuesearch({
         {% if 'tipue_search' in PLUGINS %}
             'mode' : 'json',
         {% else %}
             'mode': 'live',
         {% endif %}
         'show': 10,
         'newWindow': false,
         {# I cannot place following statements in the conditionals above because then Tipue Search fails to work. Possibly a bug in Tipue Search. #}
         {% if 'tipue_search' in PLUGINS %}
             'contentLocation': 'tipuesearch_content.json'
         {% else %}
             'liveDescription': '.article-content'
         {% endif %}
     });
});
</script>
{% endblock script %}

{% block content %}
<article>
    <div class="span8 offset2">
        <div id="tipue_search_content"><div id="tipue_search_loading"></div></div>
    </div>
</article>
{% endblock content %}
