From 631c02ac689b3366987918737e2b09f52fb16dda Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 9 May 2024 19:36:03 +0200 Subject: feat: dynamically link to sources --- internal/server/server.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'internal/server') 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) -- cgit 1.4.1