added search suggestions to opensearch
This commit is contained in:
parent
fd78b1d4fa
commit
a520488de8
1 changed files with 10 additions and 4 deletions
|
@ -12,7 +12,7 @@ type OpenSearchDescription struct {
|
||||||
ShortName string `xml:"ShortName"`
|
ShortName string `xml:"ShortName"`
|
||||||
Description string `xml:"Description"`
|
Description string `xml:"Description"`
|
||||||
Tags string `xml:"Tags"`
|
Tags string `xml:"Tags"`
|
||||||
URL URL `xml:"Url"`
|
URLs []URL `xml:"Url"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type URL struct {
|
type URL struct {
|
||||||
|
@ -28,9 +28,15 @@ func generateOpenSearchXML(config Config) {
|
||||||
ShortName: "Search Engine",
|
ShortName: "Search Engine",
|
||||||
Description: "Search engine",
|
Description: "Search engine",
|
||||||
Tags: "search, engine",
|
Tags: "search, engine",
|
||||||
URL: URL{
|
URLs: []URL{
|
||||||
Type: "text/html",
|
{
|
||||||
Template: fmt.Sprintf("%s/search?q={searchTerms}", baseURL),
|
Type: "text/html",
|
||||||
|
Template: fmt.Sprintf("%s/search?q={searchTerms}", baseURL),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Type: "application/x-suggestions+json",
|
||||||
|
Template: fmt.Sprintf("%s/suggestions?q={searchTerms}", baseURL),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue