Searching on a static website

It is over four years since I moved this website from being powered by WordPress to being static set of HTML files generated by Pelican. One of side effects was lack of search option. But not any more.

JavaScript, WebAssembly…

Modern webdevelopment is completely other area than one I left 16 years ago. JavaScript is no longer language to animate menu or manage change of graphics when user taps on page. And there is WebAssembly when something more efficient is needed.

Stork

Pelican, Stork… I do not know how those two bird species are connected but those two projects can be used together. One provides static website, second gives a way to search it.

Stork was the first project I looked at. There were some things to improve but overall it worked. I planned to add loading of index (8.2MB file) only when someone taps search input.

And during last weekend author ended Stork’s development…

Pagefind

I checked other options and decided to go with Pagefind instead.

Indexer is written in Rust, WebAssembly part as well. Contrary to Stork, Pagefind splits index files into chunks which are loaded when needed.

Some metadata tags were needed here and there in HTML templates and final effect is good enough. After some minimal CSS changes you can see search option on the right side of website.

development website