Skip to content

Commit

Permalink
patch PR #1440 (#1441)
Browse files Browse the repository at this point in the history
* alternative implementation

* typo

* refactor noop

* rename SearchAlgolia -> SearchBar

* changes.md
  • Loading branch information
endiliey authored May 8, 2019
1 parent 87c746a commit fdf1054
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 19 deletions.
4 changes: 2 additions & 2 deletions packages/docusaurus-preset-classic/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ module.exports = function preset(context, opts = {}) {
return {
themes: [
{
name: '@docusaurus/theme-search-algolia',
name: '@docusaurus/theme-classic',
},
{
name: '@docusaurus/theme-classic',
name: '@docusaurus/theme-search-algolia',
},
],
plugins: [
Expand Down
10 changes: 0 additions & 10 deletions packages/docusaurus-theme-classic/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ class DocusaurusThemeClassic {
getThemePath() {
return path.resolve(__dirname, './theme');
}

configureWebpack() {
return {
resolve: {
alias: {
'@theme/SearchAlgolia': path.resolve(__dirname, './noopModule.js'),
},
},
};
}
}

module.exports = DocusaurusThemeClassic;
4 changes: 2 additions & 2 deletions packages/docusaurus-theme-classic/src/theme/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';

import SearchAlgolia from '@theme/SearchAlgolia';
import SearchBar from '@theme/SearchBar';

function Navbar() {
const context = useDocusaurusContext();
Expand Down Expand Up @@ -75,7 +75,7 @@ function Navbar() {
<div className="navbar__items navbar__items--right">
{algolia && (
<div className="navbar__search" key="search-box">
<SearchAlgolia />
<SearchBar />
</div>
)}
</div>
Expand Down
8 changes: 8 additions & 0 deletions packages/docusaurus-theme-classic/src/theme/SearchBar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

export {default} from '@docusaurus/Noop';
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class Search extends React.Component {

componentDidMount() {
const {siteConfig = {}, metadata = {}} = this.context;
console.log(siteConfig);
const {version: thisVersion, language: thisLanguage} = metadata;
const {
themeConfig: {algolia},
Expand Down
4 changes: 0 additions & 4 deletions packages/docusaurus/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ headerLinks: [
{ url: "help", label: "Help" },
// Links to href destination/ external page
{ href: "https://github.com/", label: "GitHub" },
// Determines search bar position among links
{ search: true },
// Determines language drop down position among links
{ languages: true }
],
```

Expand Down

0 comments on commit fdf1054

Please sign in to comment.