Re-enabling search on my static website
When I migrated this website from Jekyll to Hugo, I decided to not migrate my search functionality. This was partly because it was too much work to think about at the time, but also as I wasn't really sure whether anyone was using it.
My workaround for this was the fact that the
/posts/ page would always list all of my posts, so I'd be able to hit that page and use the browser's search to find it.
Well, that was all well and good until early March when I enabled pagination in my site, which meant that
/posts/ would be limited to 10 posts per page, meaning my > 100 posts were now harder to search. Instead, I either needed to remember the taxonomy I'd used (which I'm generally pretty good with) or would have to trawl through the paginated posts.
This got until the other day where I decided enough was enough, and decided to properly solve it - which is what I'm announcing now, and was implemented at tonight's Homebrew Website Club in Nottingham.
I hooked this in by using my JSON Feed which I implemented at the beginning of April, and is a great format for searching on. This means I don't need to create a separate format just for the sake of search, too, which was a big plus point for me!
Give it a go on
/search/ and let me know what you think!
Interestingly, as per the Indieweb levels for search I may qualify for Level 5, because it's all done client-side. Which is pretty lucky because this site is super static and I don't want to be relying on 3rd party services to host search.