mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 16:59:06 +02:00
fix(v2): sidebar not appearing on index.html version
This commit is contained in:
parent
b3cf9c62d5
commit
569985ad80
2 changed files with 4 additions and 1 deletions
|
@ -21,6 +21,7 @@ import styles from './styles.module.css';
|
|||
function Doc(props) {
|
||||
const {siteConfig = {}} = useContext(DocusaurusContext);
|
||||
const {route, docsMetadata, location} = props;
|
||||
console.log(props);
|
||||
const {baseUrl, favicon} = siteConfig;
|
||||
return (
|
||||
<Layout>
|
||||
|
|
|
@ -14,7 +14,9 @@ import styles from './styles.module.css';
|
|||
function Sidebar(props) {
|
||||
const {docsMetadata, location} = props;
|
||||
|
||||
const id = docsMetadata.permalinkToId[location.pathname];
|
||||
const id =
|
||||
docsMetadata.permalinkToId[location.pathname] ||
|
||||
docsMetadata.permalinkToId[location.pathname.replace(/\/$/, '')];
|
||||
const metadata = docsMetadata.docs[id] || {};
|
||||
const {sidebar, language} = metadata;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue