Let readers search your Kite site in their browser, with nothing to run.
English · 简体中文
Search is an official plugin for Kite. The index is written when your site is built and searched in the reader's browser, so it works wherever the site does, GitHub Pages included.
- Nothing to run. No search server, no service to sign up for and no key to keep: one index file, published with the site.
- Opens from anywhere. A button in the corner of every page,
/orCtrl K(⌘ Kon a Mac), or a search button of your theme's own. - Finds unspaced languages too. Words match anywhere in a title, a tag or the text, so Chinese and Japanese are found without splitting words.
- Looks like your site. It takes the page's font, follows light and dark mode, and marks what matched in each result.
- Indexes what readers read. Code and markup stay out of the index, and a
post stays out altogether with
search: falsein its front matter. - Costs nothing until used. The index is fetched the first time a reader opens the search, not with every page.
- Download
search-<version>.zipfrom the latest release. - In Kite's studio, open Plugins, drop the zip on Upload plugin, and switch it on.
Or from the command line, inside your site:
kite plugin add search-0.1.0.zip
kite plugin enable searchIt needs Kite 0.1 or later.
| Setting | Default | What it does |
|---|---|---|
| Search whole posts | On | Indexes the whole text of every post. Turned off, only titles, tags and summaries are searched, which keeps the index small on a large site |
| Search button | On | Shows a search button in the corner of every page. It is left out where the theme has its own |
Any element marked data-kite-search opens the search, and the corner button
is then left out:
<button type="button" data-kite-search>Search</button>Once the site is built, the plugin's module, plugin.wasm, is handed every
page and writes plugins/search/index.json: the address, title, date, tags
and text of each post and page, newest first. search.js loads it the first
time a reader opens the search and matches every word they type. The module
runs in Kite's sandbox: no network and no files, only the pages it is handed.
The module is Go, built for WebAssembly with Go 1.24 or later.
make test # the index, on this computer
make build # plugin.wasm
kite plugin verify .To try it on a site, kite plugin add /path/to/plugin-search copies this
folder in, module included.
Set version in plugin.yaml, commit, and push a tag of the same version,
such as v0.1.0. The release workflow tests and builds the module, packs
dist/search-<version>.zip without the module's source, and attaches it to a
GitHub release. make zip packs the same file locally.
| Plugin | What it adds |
|---|---|
| Analytics | Visit counts with Baidu Tongji, Google Analytics, Umami or Plausible |
| Comments | A comment thread under every post, with Giscus, Waline or Twikoo |
| Math and Diagrams | TeX math with KaTeX, and mermaid code blocks drawn as diagrams |
