diff options
author | Alan Pearce | 2024-05-09 19:36:03 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-09 19:36:03 +0200 |
commit | 631c02ac689b3366987918737e2b09f52fb16dda (patch) | |
tree | 0ae231c0a1ba2bd1cf255ea260129440056ac509 /internal/server/server.go | |
parent | f42dfe7b5fd3d60c9558eb520d33c7c8fd1ba201 (diff) | |
download | searchix-631c02ac689b3366987918737e2b09f52fb16dda.tar.lz searchix-631c02ac689b3366987918737e2b09f52fb16dda.tar.zst searchix-631c02ac689b3366987918737e2b09f52fb16dda.zip |
feat: dynamically link to sources
Diffstat (limited to 'internal/server/server.go')
-rw-r--r-- | internal/server/server.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/server/server.go b/internal/server/server.go index 6b7f31c..e343434 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -63,6 +63,7 @@ const jsSnippet = template.HTML(livereload.JsSnippet) // #nosec G203 type TemplateData struct { LiveReload template.HTML + Sources map[string]*importer.Source Source importer.Source Query string Results bool @@ -125,6 +126,7 @@ func New(runtimeConfig *Config) (*Server, error) { mux := http.NewServeMux() indexData := TemplateData{ LiveReload: jsSnippet, + Sources: config.Sources, } mux.HandleFunc("/{$}", func(w http.ResponseWriter, _ *http.Request) { err := templates["index"].ExecuteTemplate(w, "index.gotmpl", indexData) |