Merge pull request #266 from lioman/master

improve loading time by moving tipue search to appropriate place
This commit is contained in:
Alexandre Vicenzi 2021-03-12 22:53:27 +01:00 committed by GitHub
commit 2fc69e12ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 27 deletions

View file

@ -70,11 +70,6 @@
{% endif %} {% endif %}
{% if PLUGINS and 'tipue_search' in PLUGINS %} {% if PLUGINS and 'tipue_search' in PLUGINS %}
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/jquery.min.js"></script>
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch.min.js"></script>
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch.min.js"></script>
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch_set.min.js"></script>
<script src="{{ SITEURL }}/tipuesearch_content.js"></script>
<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch.min.css" /> <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch.min.css" />
{% endif %} {% endif %}
@ -300,14 +295,6 @@
{% include 'partial/github.html' %} {% include 'partial/github.html' %}
{% endif %} {% endif %}
{% if PLUGINS and 'tipue_search' in PLUGINS %}
<script>
$(document).ready(function() {
$('#tipue_search_input').tipuesearch();
});
</script>
{% endif %}
{% block additional_js %}{% endblock %} {% block additional_js %}{% endblock %}
</body> </body>
</html> </html>

View file

@ -2,21 +2,26 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% block title %}{{ _('Search') }} - {{ SITENAME|striptags }}{% endblock title %} {% block title %}{{ _('Search') }} - {{ SITENAME|striptags }}{% endblock title %}
{% block content %} {% block content %}
<script>
$(document).ready(function() {
$('#tipue_search_input').tipuesearch({
'show': 10,
'mode': 'json',
'contentLocation': '{{ SITEURL }}/tipuesearch_content.js'
});
});
</script>
<article class="single"> <article class="single">
<header> <header>
<h1 id="categories">{{ _('Search Results') }}</h1> <h1 id="categories">{{ _('Search Results') }}</h1>
</header> </header>
<div id="tipue_search_content"></div> <div id="tipue_search_content"></div>
</article> </article>
{% endblock content %} {% endblock content %}
{% block additional_js %}
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/jquery.min.js"></script>
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch.min.js"></script>
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/tipuesearch/tipuesearch_set.min.js"></script>
<script src="{{ SITEURL }}/tipuesearch_content.js"></script>
<script>
$(document).ready(function () {
$("#tipue_search_input").tipuesearch({
show: 10,
mode: "json",
contentLocation: "{{ SITEURL }}/tipuesearch_content.js",
});
});
</script>
{% endblock additional_js %}
{% endif %} {% endif %}