add search support using fusejs
This commit is contained in:
parent
844f9fcfa7
commit
ce0ce5be25
14 changed files with 156 additions and 26 deletions
16
layouts/_default/search.html
Normal file
16
layouts/_default/search.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{{ define "main" }}
|
||||
<main class="container mx-auto">
|
||||
{{- $title := .Site.Params.search.title | default .Title }}
|
||||
{{- $placeholder := .Site.Params.search.placeholder | default .Title }}
|
||||
<h1 class="text-4xl font-extrabold mt-6">{{ $title }}</h1>
|
||||
<p class="text-sm mb-6">Powered by <a href="https://fusejs.io" target="_blank">fuse.js</a>.</p>
|
||||
<div class="search">
|
||||
<input class="mb-4"
|
||||
autofocus autocomplete="off" id="search-input" type="search" placeholder="{{ printf `%s ↵` $placeholder }}">
|
||||
{{ if not .Site.Params.search.enable }}
|
||||
<p>No search plugin is enabled.</p>
|
||||
{{ end }}
|
||||
<ul id="search-result"></ul>
|
||||
</div>
|
||||
</main>
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue