mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-07 13:22:26 +02:00
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:
parent
fe6b841642
commit
f5494af21c
2 changed files with 4 additions and 4 deletions
|
@ -59,8 +59,8 @@ function theme(context) {
|
||||||
path.join(outDir, OPEN_SEARCH_FILENAME),
|
path.join(outDir, OPEN_SEARCH_FILENAME),
|
||||||
renderOpenSearchTemplate({
|
renderOpenSearchTemplate({
|
||||||
title,
|
title,
|
||||||
url,
|
url: url + baseUrl,
|
||||||
favicon: normalizeUrl([url, favicon]),
|
favicon: normalizeUrl([url, baseUrl, favicon]),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
@ -13,8 +13,8 @@ module.exports = `
|
||||||
<Description>Search <%= it.title %></Description>
|
<Description>Search <%= it.title %></Description>
|
||||||
<InputEncoding>UTF-8</InputEncoding>
|
<InputEncoding>UTF-8</InputEncoding>
|
||||||
<Image width="16" height="16" type="image/x-icon"><%= it.favicon %></Image>
|
<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="text/html" method="get" template="<%= it.url %>search?q={searchTerms}"/>
|
||||||
<Url type="application/opensearchdescription+xml" rel="self" template="<%= it.url %>/opensearch.xml" />
|
<Url type="application/opensearchdescription+xml" rel="self" template="<%= it.url %>opensearch.xml" />
|
||||||
<moz:SearchForm><%= it.url %></moz:SearchForm>
|
<moz:SearchForm><%= it.url %></moz:SearchForm>
|
||||||
</OpenSearchDescription>
|
</OpenSearchDescription>
|
||||||
`;
|
`;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue