docs: add Lunr.js search with fuzzy matching and highlighting

Phase 4 part 1: Add search infrastructure
- Add SearchDoc struct and GenerateSearchIndex to docs handler
- Add stripHTML helper for plain text extraction
- Add ServeSearchIndex endpoint to http handler
- Add /docs/search-index.json route in main.go
- Search index includes all documentation files with ID, title, content, URL
This commit is contained in:
2026-02-02 09:08:37 -05:00
parent 3b3630666a
commit 542fbaf116
5 changed files with 406 additions and 60 deletions
+1
View File
@@ -607,6 +607,7 @@ func main() {
e.GET("/docs", docsHandler.DocsHome)
e.GET("/docs/*", docsHandler.ShowDocumentation)
e.GET("/docs/api/search", docsHandler.Search)
e.GET("/docs/search-index.json", docsHandler.ServeSearchIndex)
// Start server
log.Printf("Starting server on port %s", cfg.ServerPort)