Wordpress

Search Integration with Hugo Static Site

While migrating from a Wordpress site to a static site in Hugo, I needed to implement some kind of search to replace the search available in the dynamic Wordpress site. There were several articles written about how to do this using the lunr.js search framework but I couldn’t get some of them to work very well so decided to write this post in case anyone else is having similar trouble.

The main idea is to generate a searchable index based on the current state of the site and then that index is used by lunr.js at runtime in the browser to execute the search.

Migrating a Blog From Wordpress to Hugo

I recently decided to migrate this blog from Wordpress to a site using the Hugo static site generator. The main goal was to simplify the hosting and learn more about the technology of static site generation. I chose Hugo mainly because it is fast and simple to use and install.

Process

The process to migrate the blog was somewhat involved because I wanted to make some improvements to the layout and hosting in addition to getting it into a new host. I also wanted to make it compatible with the old permalinks which turned out to be a bit of a challenge.