diff options
author | Alan Pearce | 2024-07-12 20:54:46 +0200 |
---|---|---|
committer | Alan Pearce | 2024-07-12 21:20:15 +0200 |
commit | 9440d2fc4250e733e1dbe25303bd2407642ff28c (patch) | |
tree | 0b66900e76db359a1372fcffd3b59c385984c331 /internal/server | |
parent | 6781684647ad7f131054a93e1d13105d865c0e83 (diff) | |
download | searchix-9440d2fc4250e733e1dbe25303bd2407642ff28c.tar.lz searchix-9440d2fc4250e733e1dbe25303bd2407642ff28c.tar.zst searchix-9440d2fc4250e733e1dbe25303bd2407642ff28c.zip |
refactor: remove unnecessary DocumentData struct
Diffstat (limited to 'internal/server')
-rw-r--r-- | internal/server/mux.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/internal/server/mux.go b/internal/server/mux.go index f98e03e..8c34599 100644 --- a/internal/server/mux.go +++ b/internal/server/mux.go @@ -245,20 +245,17 @@ func NewMux( return } - tdata := components.DocumentData{ - TemplateData: components.TemplateData{ - ExtraHeadHTML: cfg.Web.ExtraHeadHTML, - Source: source, - Sources: sources, - Assets: frontend.Assets, - }, - Document: doc, + tdata := components.TemplateData{ + ExtraHeadHTML: cfg.Web.ExtraHeadHTML, + Source: source, + Sources: sources, + Assets: frontend.Assets, } if r.Header.Get("Fetch") == "true" { w.Header().Add("Content-Type", "text/html; charset=utf-8") err = components.Detail(*doc).Render(r.Context(), w) } else { - err = components.DetailPage(tdata.TemplateData, *doc).Render(r.Context(), w) + err = components.DetailPage(tdata, *doc).Render(r.Context(), w) } if err != nil { log.Error("template error", "template", importerSingular, "error", err) |