From f5494af21c74b6ab60f7198afa04f8c2716d3a92 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Tue, 2 Feb 2021 20:09:46 +0300 Subject: [PATCH] fix(v2): add base url to opensearch.xml (#4154) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(v2): add base url to opensearch.xml * Apply suggestions from code review Co-authored-by: Sébastien Lorber Co-authored-by: Sébastien Lorber --- packages/docusaurus-theme-search-algolia/src/index.js | 4 ++-- .../src/templates/opensearch.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus-theme-search-algolia/src/index.js b/packages/docusaurus-theme-search-algolia/src/index.js index 186857bd608c..ffc015b67600 100644 --- a/packages/docusaurus-theme-search-algolia/src/index.js +++ b/packages/docusaurus-theme-search-algolia/src/index.js @@ -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) { diff --git a/packages/docusaurus-theme-search-algolia/src/templates/opensearch.js b/packages/docusaurus-theme-search-algolia/src/templates/opensearch.js index adb802ee7e8d..1284223c7d47 100644 --- a/packages/docusaurus-theme-search-algolia/src/templates/opensearch.js +++ b/packages/docusaurus-theme-search-algolia/src/templates/opensearch.js @@ -13,8 +13,8 @@ module.exports = ` Search <%= it.title %> UTF-8 <%= it.favicon %> - - + + <%= it.url %> `;