all repos — searchix @ 560b6350141050cd4b9aa5717acf5c241996a978

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

fix: changing facets reverted to combined search

Alan Pearce
commit

560b6350141050cd4b9aa5717acf5c241996a978

parent

8a29e39f16bec9ff7d3c264173862acdcfa272c5

1 file changed, 12 insertions(+), 0 deletions(-)

changed files
M internal/config/structs.gointernal/config/structs.go
@@ -5,6 +5,7 @@ // keep config structs here so that lll ignores the long lines (go doesn't support multi-line struct tags)
import ( "fmt" + "net/url" "path/filepath" "strings"
@@ -90,3 +91,14 @@ func (source *Source) JoinFilePath(name string) string {
//nolint:forbidigo // is not absolute return filepath.Join("sources", source.Key, name) } + +func (source *Source) LocalURL() *url.URL { + p, err := url.JoinPath("/", source.Importer.String(), source.Key, "/") + if err != nil { + panic(err.Error()) + } + + return &url.URL{ + Path: p, + } +}