a-luna / aaronluna.dev

My personal website/blog/portfolio, built with Hugo
https://aaronluna.dev
3 stars 1 forks source link

blog/add-search-to-static-site-lunrjs-hugo-vanillajs/ #95

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Add Search to Your Static Site with Lunr.js (Hugo, Vanilla JS) - aaronluna.dev

Introduction If you DuckDuckGo or bing! the phrase “add search to static site”, you will find hundreds of articles explaining how a client-side search product like Lunr.js can be integrated with Hugo, Eleventy or Gatsby. Given this fact, I feel compelled to explain why I created this blog post when it appears that this question has been sufficiently answered. I decided to document my Hugo/Lunr.js solution because unlike other guides I found while researching this subject, my implementation:

https://aaronluna.dev/blog/add-search-to-static-site-lunrjs-hugo-vanillajs/

hrishikesh-k commented 3 years ago

Hey! Thanks a lot for this amazing guide. I managed to get it working on my website, the way I'd have wanted it. However, the only problem I'm facing is that, the text content within my shortcodes is also getting rendered in search index. Is there any way to stop it? I'd like if only the markdown text is added in the JSON. Here's my repo: https://www.github.com/Hrishikesh-K/Portfolio

UPDATE: I fixed it by converting the static text in markup to dynamically generated text using JavaScript as it wasn't very much important for SEO (they were merely image captions below images).

titieo commented 3 years ago

Thanks for your amazing guide!!!

scbot1729 commented 2 years ago

Thanks exactly what I needed.

Too good

duffn commented 1 year ago

Excellent post, thank you.