From 28c239dc4207c3a7c8c09cf8084f102045d50f3a Mon Sep 17 00:00:00 2001 From: Kevin Whinnery Date: Sat, 2 Sep 2023 09:57:40 -0500 Subject: [PATCH] add footer to main page --- src/css/custom.css | 16 ++---- src/theme/DocPage/Layout/Main/index.js | 28 +++++++++++ .../DocPage/Layout/Main/styles.module.css | 21 ++++++++ src/theme/Layout/Provider/index.js | 21 ++++++++ src/theme/Layout/index.js | 50 +++++++++++++++++++ src/theme/Layout/styles.module.css | 21 ++++++++ 6 files changed, 145 insertions(+), 12 deletions(-) create mode 100644 src/theme/DocPage/Layout/Main/index.js create mode 100644 src/theme/DocPage/Layout/Main/styles.module.css create mode 100644 src/theme/Layout/Provider/index.js create mode 100644 src/theme/Layout/index.js create mode 100644 src/theme/Layout/styles.module.css diff --git a/src/css/custom.css b/src/css/custom.css index 91a56c5c4..c279294b4 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -44,6 +44,10 @@ html, body { + width: 100%; + height: 100%; + overflow-x: hidden; + overflow-y: auto; font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; } @@ -71,18 +75,6 @@ h3 { max-width: 1140px !important; } -@media screen and (min-width: 768px) { - .container { - margin-top: 1.5rem; - margin-left: 3rem; - } - - footer>.container { - margin-top: 2rem; - margin-left: auto; - } -} - /* Hide breadcrumbs */ .theme-doc-breadcrumbs { display: none; diff --git a/src/theme/DocPage/Layout/Main/index.js b/src/theme/DocPage/Layout/Main/index.js new file mode 100644 index 000000000..19a3b7ff3 --- /dev/null +++ b/src/theme/DocPage/Layout/Main/index.js @@ -0,0 +1,28 @@ +import React from 'react'; +import clsx from 'clsx'; +import {useDocsSidebar} from '@docusaurus/theme-common/internal'; +import styles from './styles.module.css'; +import Footer from '@theme/Footer'; + +export default function DocPageLayoutMain({hiddenSidebarContainer, children}) { + const sidebar = useDocsSidebar(); + return ( +
+
+
+ {children} +
+
+
+
+ ); +} diff --git a/src/theme/DocPage/Layout/Main/styles.module.css b/src/theme/DocPage/Layout/Main/styles.module.css new file mode 100644 index 000000000..096eb0649 --- /dev/null +++ b/src/theme/DocPage/Layout/Main/styles.module.css @@ -0,0 +1,21 @@ +.docMainContainer { + display: flex; + width: 100%; +} + +@media (min-width: 997px) { + .docMainContainer { + flex-grow: 1; + max-width: calc(100% - var(--doc-sidebar-width)); + } + + .docMainContainerEnhanced { + max-width: calc(100% - var(--doc-sidebar-hidden-width)); + } + + .docItemWrapperEnhanced { + max-width: calc( + var(--ifm-container-width) + var(--doc-sidebar-width) + ) !important; + } +} diff --git a/src/theme/Layout/Provider/index.js b/src/theme/Layout/Provider/index.js new file mode 100644 index 000000000..a94f0b3e2 --- /dev/null +++ b/src/theme/Layout/Provider/index.js @@ -0,0 +1,21 @@ +import React from 'react'; +import {composeProviders} from '@docusaurus/theme-common'; +import { + ColorModeProvider, + AnnouncementBarProvider, + DocsPreferredVersionContextProvider, + ScrollControllerProvider, + NavbarProvider, + PluginHtmlClassNameProvider, +} from '@docusaurus/theme-common/internal'; +const Provider = composeProviders([ + ColorModeProvider, + AnnouncementBarProvider, + ScrollControllerProvider, + DocsPreferredVersionContextProvider, + PluginHtmlClassNameProvider, + NavbarProvider, +]); +export default function LayoutProvider({children}) { + return {children}; +} diff --git a/src/theme/Layout/index.js b/src/theme/Layout/index.js new file mode 100644 index 000000000..2b7019ef8 --- /dev/null +++ b/src/theme/Layout/index.js @@ -0,0 +1,50 @@ +import React from 'react'; +import clsx from 'clsx'; +import ErrorBoundary from '@docusaurus/ErrorBoundary'; +import { + PageMetadata, + SkipToContentFallbackId, + ThemeClassNames, +} from '@docusaurus/theme-common'; +import {useKeyboardNavigation} from '@docusaurus/theme-common/internal'; +import SkipToContent from '@theme/SkipToContent'; +import AnnouncementBar from '@theme/AnnouncementBar'; +import Navbar from '@theme/Navbar'; +import Footer from '@theme/Footer'; +import LayoutProvider from '@theme/Layout/Provider'; +import ErrorPageContent from '@theme/ErrorPageContent'; +import styles from './styles.module.css'; +export default function Layout(props) { + const { + children, + noFooter, + wrapperClassName, + // Not really layout-related, but kept for convenience/retro-compatibility + title, + description, + } = props; + useKeyboardNavigation(); + return ( + + + + + + + + + +
+ }> + {children} + +
+
+ ); +} diff --git a/src/theme/Layout/styles.module.css b/src/theme/Layout/styles.module.css new file mode 100644 index 000000000..92690477d --- /dev/null +++ b/src/theme/Layout/styles.module.css @@ -0,0 +1,21 @@ +html, +body { + height: 100%; +} + +.mainWrapper { + flex: 1 0 auto; + display: flex; + flex-direction: column; +} + +/* Docusaurus-specific utility class */ +:global(.docusaurus-mt-lg) { + margin-top: 3rem; +} + +:global(#__docusaurus) { + min-height: 100%; + display: flex; + flex-direction: column; +}