move search files to search page
- To speed up page load the js files should be loaded on bottom of page. - search files are only needed if you search. Move them to search page - instantiate tipue search only on search page
This commit is contained in:
parent
6fe38c6986
commit
cd7d10f5c9
2 changed files with 21 additions and 30 deletions
|
@ -295,18 +295,6 @@
|
||||||
{% include 'partial/github.html' %}
|
{% include 'partial/github.html' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% 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_set.min.js"></script>
|
|
||||||
<script src="{{ SITEURL }}/tipuesearch_content.js"></script>
|
|
||||||
<script>
|
|
||||||
$(document).ready(function() {
|
|
||||||
$('#tipue_search_input').tipuesearch();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% block additional_js %}{% endblock %}
|
{% block additional_js %}{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,22 +1,25 @@
|
||||||
{% if PLUGINS and 'tipue_search' in PLUGINS %}
|
{% if PLUGINS and 'tipue_search' in PLUGINS %} {% 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 %}
|
||||||
{% endif %}
|
<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 %} {% endif %}
|
||||||
|
|
Loading…
Reference in a new issue