all repos — searchix @ dec2c516100350a78f0b7116bc6f9d76325e7760

Search engine for NixOS, nix-darwin, home-manager and NUR users

refactor: instantiate AssetCollection explicitly

Alan Pearce
commit

dec2c516100350a78f0b7116bc6f9d76325e7760

parent

0ae74e5f6af61819e8f954960287ea14ec447834

1 file changed, 7 insertions(+), 2 deletions(-)

changed files
M cmd/searchix-web/main.gocmd/searchix-web/main.go
@@ -55,14 +55,19 @@ }
os.Exit(0) } if *generateErrorPage { - err := components.ErrorTemplate(components.TemplateData{ + assets, err := frontend.New() + if err != nil { + panic("failed to create assets: " + err.Error()) + } + + err = components.ErrorTemplate(components.TemplateData{ Source: nil, Sources: []*config.Source{}, Query: "", ExtraHeadHTML: "", Code: 0, Message: `{{placeholder "http.error.status_code"}} {{placeholder "http.error.status_text"}}`, - Assets: frontend.Assets, + Assets: assets, }).Render(os.Stdout) if err != nil { panic("failed to render error template: " + err.Error())