mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-23 11:38:48 +02:00
fix(v2): use swizzled SearchPage component if any (#3721)
* fix(v2): use swizzled SearchPage component if any * Fix dependency cycles warning
This commit is contained in:
parent
702fc15c8e
commit
8ef7c24583
3 changed files with 20 additions and 3 deletions
|
@ -8,7 +8,7 @@
|
|||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const eta = require('eta');
|
||||
const {normalizeUrl} = require('@docusaurus/utils');
|
||||
const {normalizeUrl, getSwizzledComponent} = require('@docusaurus/utils');
|
||||
const openSearchTemplate = require('./templates/opensearch');
|
||||
const {validateThemeConfig} = require('./validateThemeConfig');
|
||||
const {memoize} = require('lodash');
|
||||
|
@ -29,7 +29,10 @@ function theme(context) {
|
|||
baseUrl,
|
||||
siteConfig: {title, url, favicon},
|
||||
} = context;
|
||||
const pagePath = path.resolve(__dirname, './theme/SearchPage/index.js');
|
||||
const pageComponent = './theme/SearchPage/index.js';
|
||||
const pagePath =
|
||||
getSwizzledComponent(pageComponent) ||
|
||||
path.resolve(__dirname, pageComponent);
|
||||
|
||||
return {
|
||||
name: 'docusaurus-theme-search-algolia',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue