feat: add icon to OpenSearch Description XML
2 files changed, 20 insertions(+), 0 deletions(-)
M internal/opensearch/opensearch.go → internal/opensearch/opensearch.go
@@ -11,6 +11,7 @@ XMLName xml.Name `xml:"http://a9.com/-/spec/opensearch/1.1/ OpenSearchDescription"` Description string LongName string ShortName string + Image Image SearchForm *config.URL `xml:"http://www.mozilla.org/2006/browser/search/ SearchForm"` URL URL `xml:"Url"` }@@ -20,3 +21,10 @@ Method string `xml:"method,attr"` Template *config.URL `xml:"template,attr"` Type string `xml:"type,attr"` } + +type Image struct { + Height uint `xml:"height,attr"` + Width uint `xml:"width,attr"` + Type string `xml:"type,attr"` + Content string +}
M internal/server/mux.go → internal/server/mux.go
@@ -311,6 +311,12 @@ source.Importer.String(), source.Key, "search", ), + Image: opensearch.Image{ + Height: 32, + Width: 32, + Type: "image/x-icon", + Content: cfg.Web.BaseURL.JoinPath("favicon.ico").String(), + }, URL: opensearch.URL{ Method: "get", Type: "text/html",@@ -346,6 +352,12 @@ ShortName: "Searchix Combined", LongName: "Search nix options and packages with Searchix", Description: "Search nix options and packages with Searchix", SearchForm: cfg.Web.BaseURL.JoinPath(), + Image: opensearch.Image{ + Height: 32, + Width: 32, + Type: "image/x-icon", + Content: cfg.Web.BaseURL.JoinPath("favicon.ico").String(), + }, URL: opensearch.URL{ Method: "get", Type: "text/html",