diff --git a/package.json b/package.json
index 5f8f5304f4..f6fd53c388 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"start:v2": "yarn workspace docusaurus-2-website start",
"start:v2:watch": "nodemon --watch \"./packages/*/lib/**/*.*\" --exec \"yarn start:v2\"",
"start:v2:baseUrl": "yarn workspace docusaurus-2-website start:baseUrl",
+ "start:v2:bootstrap": "yarn workspace docusaurus-2-website start:bootstrap",
"build": "yarn build:packages && yarn build:v2",
"build:packages": "lerna run build --no-private",
"build:v1": "yarn workspace docusaurus-1-website build",
diff --git a/packages/docusaurus-init/templates/bootstrap/src/pages/index.js b/packages/docusaurus-init/templates/bootstrap/src/pages/index.js
index 9e4af6d085..27de9db3bc 100644
--- a/packages/docusaurus-init/templates/bootstrap/src/pages/index.js
+++ b/packages/docusaurus-init/templates/bootstrap/src/pages/index.js
@@ -62,24 +62,26 @@ function Home() {
-
- {siteConfig.title}
- {siteConfig.tagline}
-
- Get Started
-
-
-
- {features && features.length > 0 && (
-
-
- {features.map((props, idx) => (
-
- ))}
-
-
- )}
-
+
+
+ {siteConfig.title}
+ {siteConfig.tagline}
+
+ Get Started
+
+
+
+ {features && features.length > 0 && (
+
+
+ {features.map((props, idx) => (
+
+ ))}
+
+
+ )}
+
+
);
}
diff --git a/packages/docusaurus-init/templates/bootstrap/src/pages/styles.module.css b/packages/docusaurus-init/templates/bootstrap/src/pages/styles.module.css
index c1aa85121c..1167b26938 100644
--- a/packages/docusaurus-init/templates/bootstrap/src/pages/styles.module.css
+++ b/packages/docusaurus-init/templates/bootstrap/src/pages/styles.module.css
@@ -24,6 +24,18 @@
justify-content: center;
}
+.hero {
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ align-items: center;
+ place-content: center;
+}
+
+.section {
+ margin: 10rem;
+}
+
.features {
display: flex;
align-items: center;
diff --git a/packages/docusaurus-theme-bootstrap/src/theme/DocPage/index.js b/packages/docusaurus-theme-bootstrap/src/theme/DocPage/index.js
index 78c691a07c..6f2922b8e3 100644
--- a/packages/docusaurus-theme-bootstrap/src/theme/DocPage/index.js
+++ b/packages/docusaurus-theme-bootstrap/src/theme/DocPage/index.js
@@ -14,34 +14,45 @@ import Layout from '@theme/Layout';
import {MDXProvider} from '@mdx-js/react';
import {matchPath} from '@docusaurus/router';
-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) => {
- return matchPath(location.pathname, route);
- }) || {};
- const {permalinkToSidebar, docsSidebars} = docsMetadata;
- const sidebar = permalinkToSidebar[currentRoute.path];
-
- if (Object.keys(currentRoute).length === 0) {
- return ;
- }
-
+function DocPageContent({currentDocRoute, versionMetadata, children}) {
+ const {permalinkToSidebar, docsSidebars} = versionMetadata;
+ const sidebarName = permalinkToSidebar[currentDocRoute.path];
+ const sidebar = docsSidebars[sidebarName];
return (
-
-
-
- {renderRoutes(baseRoute.routes)}
-
-
+
+ {sidebar && (
+
+
+
+ )}
+
+ {children}
+
+
);
}
+function DocPage(props) {
+ const {
+ route: {routes: docRoutes},
+ versionMetadata,
+ location,
+ } = props;
+ const currentDocRoute = docRoutes.find((docRoute) =>
+ matchPath(location.pathname, docRoute),
+ );
+ if (!currentDocRoute) {
+ return ;
+ }
+ return (
+
+ {renderRoutes(docRoutes)}
+
+ );
+}
+
export default DocPage;
diff --git a/packages/docusaurus-theme-bootstrap/src/theme/DocSidebar/index.js b/packages/docusaurus-theme-bootstrap/src/theme/DocSidebar/index.js
index 19e8301e42..bf07afb1ed 100644
--- a/packages/docusaurus-theme-bootstrap/src/theme/DocSidebar/index.js
+++ b/packages/docusaurus-theme-bootstrap/src/theme/DocSidebar/index.js
@@ -61,9 +61,7 @@ const DocSidebarItem = ({item, onItemClick, ...props}) => {
}
};
-const DocSidebar = (props) => {
- const {docsSidebars, sidebar: currentSidebar} = props;
-
+const DocSidebar = ({sidebar, path}) => {
const [sidebarShown, setSidebarShown] = useState(false);
const handleSidebarToggle = useCallback(() => {
setSidebarShown(!sidebarShown);
@@ -71,18 +69,6 @@ const DocSidebar = (props) => {
useLockBodyScroll(sidebarShown);
- if (!currentSidebar) {
- return null;
- }
-
- const sidebarData = docsSidebars[currentSidebar];
-
- if (!sidebarData) {
- throw new Error(
- `Cannot find the sidebar "${currentSidebar}" in the sidebar config!`,
- );
- }
-
return (
{