fix(v2): add base url to opensearch.xml (#4154)

* fix(v2): add base url to opensearch.xml

* Apply suggestions from code review

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
This commit is contained in:
Alexey Pyltsyn 2021-02-02 20:09:46 +03:00 committed by GitHub
parent fe6b841642
commit f5494af21c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -59,8 +59,8 @@ function theme(context) {
path.join(outDir, OPEN_SEARCH_FILENAME),
renderOpenSearchTemplate({
title,
url,
favicon: normalizeUrl([url, favicon]),
url: url + baseUrl,
favicon: normalizeUrl([url, baseUrl, favicon]),
}),
);
} catch (err) {

View file

@ -13,8 +13,8 @@ module.exports = `
<Description>Search <%= it.title %></Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon"><%= it.favicon %></Image>
<Url type="text/html" method="get" template="<%= it.url %>/search?q={searchTerms}"/>
<Url type="application/opensearchdescription+xml" rel="self" template="<%= it.url %>/opensearch.xml" />
<Url type="text/html" method="get" template="<%= it.url %>search?q={searchTerms}"/>
<Url type="application/opensearchdescription+xml" rel="self" template="<%= it.url %>opensearch.xml" />
<moz:SearchForm><%= it.url %></moz:SearchForm>
</OpenSearchDescription>
`;