search.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {% extends 'base.html' %}
  2. {% block title %}
  3. Search · {{ super() }}
  4. {% endblock title %}
  5. {% block head_description %}
  6. Search results for {{ SITENAME|striptags }} blog.
  7. {% endblock head_description %}
  8. {% block script %}
  9. <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
  10. <script type="text/javascript" src="{{ SITEURL }}/theme/tipuesearch/tipuesearch_set.js"></script>
  11. <script type="text/javascript" src="{{ SITEURL }}/theme/tipuesearch/tipuesearch.min.js"></script>
  12. <script>
  13. $(document).ready(function() {
  14. $('#tipue_search_input').tipuesearch({
  15. {% if 'tipue_search' in PLUGINS %}
  16. 'mode' : 'json',
  17. {% else %}
  18. 'mode': 'live',
  19. {% endif %}
  20. 'show': 10,
  21. 'newWindow': false,
  22. {# I cannot place following statements in the conditionals above because then Tipue Search fails to work. Possibly a bug in Tipue Search. #}
  23. {% if 'tipue_search' in PLUGINS %}
  24. 'contentLocation': '{{ SITEURL }}/tipuesearch_content.json'
  25. {% else %}
  26. 'liveDescription': '.article-content'
  27. {% endif %}
  28. });
  29. });
  30. </script>
  31. {% endblock script %}
  32. {% block content %}
  33. <article>
  34. <div class="span8 offset2">
  35. <div id="tipue_search_content"><div id="tipue_search_loading"></div></div>
  36. </div>
  37. </article>
  38. {% endblock content %}