all repos — searchix @ 5521173ea0e05bda93096b51f67c5e813cb1d87e

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

feat: add browser search engines via opensearch description https://developer.mozilla.org/en-US/docs/Web/OpenSearch

Alan Pearce
commit

5521173ea0e05bda93096b51f67c5e813cb1d87e

parent

9437f522c2ed21950acde884cafc369ca45f4b7b

1 file changed, 15 insertions(+), 1 deletion(-)

changed files
M internal/server/templates.gointernal/server/templates.go
@@ -81,8 +81,22 @@ return nil, err
} templates["index"] = index - glob := path.Join(templateDir, "blocks", "*.gotmpl") + glob := path.Join(templateDir, "*.gotmpl") templatePaths, err := fs.Glob(frontend.Files, glob) + if err != nil { + return nil, errors.WithMessage(err, "could not glob main templates") + } + for _, fullname := range templatePaths { + tpl, err := loadTemplate(layoutFile, fullname) + if err != nil { + return nil, err + } + name, _ := strings.CutSuffix(path.Base(fullname), ".gotmpl") + templates[name] = tpl + } + + glob = path.Join(templateDir, "blocks", "*.gotmpl") + templatePaths, err = fs.Glob(frontend.Files, glob) if err != nil { return nil, errors.WithMessage(err, "could not glob block templates") }