Skip to content

Commit

Permalink
fix(v2): add base url to opensearch.xml (#4154)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
lex111 and slorber authored Feb 2, 2021
1 parent fe6b841 commit f5494af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/docusaurus-theme-search-algolia/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
`;

0 comments on commit f5494af

Please sign in to comment.