#42 Add suppor for client-side search (#227)

* Add support for client-side search with Fuse.js. Implements #42.

Based on https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae

* Move search form code repeated in many places to one single template.

* Add search box in home page.

* Fix search UI + Some improvements

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Remove search.md from exampleSite

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

Co-authored-by: Emruz Hossain <hossainemruz@gmail.com>
This commit is contained in:
Chuso Pérez 2021-03-13 18:43:10 +01:00 committed by GitHub
parent 03ea0fae8c
commit 0848be17ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 254 additions and 2 deletions

View file

@ -16,7 +16,9 @@
<section class="sidebar-section" id="sidebar-section">
<div class="sidebar-holder">
<div class="sidebar" id="sidebar">
<input type="text" value="" placeholder="Search" data-search="" id="search-box" />
<form class="mx-auto" method="get" action="{{ "search" | absURL }}">
<input type="text" name="keyword" value="" placeholder="Search" data-search="" id="search-box" />
</form>
<div class="sidebar-tree">
<ul class="tree" id="tree">
<li id="list-heading"><a href="{{ "/posts" | relLangURL }}" data-filter="all">{{ i18n "posts" }}</a></li>