Example of search functionality for JAMstack sites using Hugo, pre-built Netlify Function (Lambda) and Lunrjs
npm run build
- During Hugo build a dump of all content is produced: [1] [2]
- This dump is later used to build a search index file using lunrjs [3]
- Finally, search index is embodied into Netlify Function and deployed along the site [4]
- That's it, after your site is deployed you can query a Netlify Function:
https://wizardly-pasteur-c5fb53.netlify.com/.netlify/functions/search?q=one
[ ] Implement example front-end search functionality in theme