Skip to content

Commit

Permalink
fix(v2): fix build and deps install (#2291)
Browse files Browse the repository at this point in the history
* docs(v1): drop support for node <10.9 (#2264)

* fix(v2): fix build and deps install

Co-authored-by: Hanseung Yoo <[email protected]>
  • Loading branch information
lex111 and trustyoo86 authored Feb 18, 2020
1 parent 21f36e5 commit 89d2d80
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions packages/docusaurus-theme-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
"react": "^16.8.4",
"react-dom": "^16.8.4"
},
"bundledDependencies": [
"@docusaurus/utils"
],
"engines": {
"node": ">=10.9.0"
}
Expand Down
10 changes: 5 additions & 5 deletions packages/docusaurus-theme-classic/src/theme/DocPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import styles from './styles.module.css';
function DocPage(props) {
const {route: baseRoute, docsMetadata, location} = props;
// case-sensitive route such as it is defined in the sidebar
const currentRoute = baseRoute.routes.find(route =>
matchPath(location.pathname, route),
);

const currentRoute =
baseRoute.routes.find(route => {
return matchPath(location.pathname, route);
}) || {};
const {permalinkToSidebar, docsSidebars, version} = docsMetadata;
const sidebar = permalinkToSidebar[currentRoute.path];
const {
Expand All @@ -33,7 +33,7 @@ function DocPage(props) {
} = useDocusaurusContext();
const {sidebarCollapsible = true} = themeConfig;

if (!currentRoute) {
if (Object.keys(currentRoute).length === 0) {
return <NotFound {...props} />;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
import useLockBodyScroll from '@theme/hooks/useLockBodyScroll';
import Link from '@docusaurus/Link';
import isInternalUrl from '@docusaurus/utils';
import isInternalUrl from '@docusaurus/utils'; // eslint-disable-line import/no-extraneous-dependencies

import styles from './styles.module.css';

Expand Down

0 comments on commit 89d2d80

Please sign in to comment.