Add empty home page to debug

This commit is contained in:
Drewbi 2020-08-17 21:00:22 +08:00
parent 2b660aa5c6
commit 9c43c9f7fb
4 changed files with 36 additions and 2 deletions

View file

@ -38,7 +38,7 @@ export default function pluginContentPages({
// Home is config (duplicate for now)
addRoute({
path: normalizeUrl([baseUrl, '__docusaurus/debug']),
component: '@theme/DebugConfig',
component: '@theme/DebugHome',
exact: true,
});

View file

@ -0,0 +1,27 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import DebugLayout from '../DebugLayout';
// import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
function DebugMetadata() {
return (
<DebugLayout>
<h2>Docusaurus Debug</h2>
<div>Config:</div>
<div>Metadata:</div>
<div>Registry:</div>
<div>Route:</div>
<div>Content:</div>
</DebugLayout>
);
}
export default DebugMetadata;

View file

@ -0,0 +1,6 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

View file

@ -26,7 +26,8 @@ function DebugLayout({children}) {
return (
<div>
<nav className={styles.nav}>
<DebugNavLink to="/__docusaurus/debug">Config</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug">Home</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/config">Config</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/metadata">Metadata</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/registry">Registry</DebugNavLink>
<DebugNavLink to="/__docusaurus/debug/routes">Routes</DebugNavLink>