Search with hugo

I’ve added a search function to the blog. I’ve been more often here and did some search of posts of my own. Because I do not like to have google or something else to search for my content I wished to add a search function.

The hugo documentation has a page for this matters. It lists various solutions to implement. I took the one without NPM or elastic search. It was implemented by a guy called ‘eddiewebb’ and does come with a simple: ‘Place this files here’ solution Basically, during the creation process of the pages with hugo, it will index the content. You add this as a searchable content and than load some additional JavaScript file that will check though the content.

The only change I’ve had to made was removing within the suggested layouts/_default/search.html the {{ define "footerfiles" }}. This was not loaded with the template that is used here. Instead I’ve moved the block further down the page. It will be loaded on the end of the page.