grav-theme-libretic/templates/partials/search.html.twig
David Raine 09407af482 Use query parameter separator from config (#25)
* Use query parameter separator from config

* Update archives.html.twig

Replace hard coded separator with config value
2017-04-12 15:06:47 +02:00

16 lines
No EOL
639 B
Twig

<form class="search-box">
<input type="search" placeholder="Search..." value="{{ query }}" data-search-input="{{ base_url_relative }}{{ config.plugins.simplesearch.route}}/query" />
<script>
jQuery(document).ready(function($){
var input = $('[data-search-input]');
input.on('keypress', function(event) {
if (event.which == 13 && input.val().length > 3) {
event.preventDefault();
window.location.href = input.data('search-input') + '{{ config.system.param_sep }}' + input.val();
}
});
});
</script>
<i class="fa fa-search"></i>
</form>