diff --git a/CHANGELOG-2.x.md b/CHANGELOG-2.x.md index feeec0b5f1..d14696b42f 100644 --- a/CHANGELOG-2.x.md +++ b/CHANGELOG-2.x.md @@ -3,8 +3,10 @@ ## Unreleased - Docs, pages plugin is rewritten in TypeScript -- Docs sidebar can now be more than one level deep, theoretically up to infinity -- Collapsible docs sidebar! +- Docs improvements and tweaks + - Docs sidebar can now be more than one level deep, theoretically up to infinity + - Collapsible docs sidebar! + - Make doc page title larger - More documentation ... - Slight tweaks to the Blog components - blog title is larger now diff --git a/packages/docusaurus-theme-classic/src/theme/DocLegacyItem/index.js b/packages/docusaurus-theme-classic/src/theme/DocLegacyItem/index.js index b6916a87b2..143820bc05 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocLegacyItem/index.js +++ b/packages/docusaurus-theme-classic/src/theme/DocLegacyItem/index.js @@ -62,29 +62,31 @@ function DocLegacyItem(props) { {permalink && }
-
-
-
-
-

{metadata.title}

-
-
-
- +
+
+
+
+
+

{metadata.title}

+
+
+
+ +
+
+
+
-
-
-
+ {DocContent.rightToc && ( +
+
+ +
+
+ )}
- {DocContent.rightToc && ( -
-
- -
-
- )}
diff --git a/packages/docusaurus-theme-classic/src/theme/DocLegacyItem/styles.module.css b/packages/docusaurus-theme-classic/src/theme/DocLegacyItem/styles.module.css index 8491fffc96..e04489c1c1 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocLegacyItem/styles.module.css +++ b/packages/docusaurus-theme-classic/src/theme/DocLegacyItem/styles.module.css @@ -5,6 +5,18 @@ * LICENSE file in the root directory of this source tree. */ +.docTitle { + font-size: 3rem; + margin-bottom: 3rem; +} + +@media only screen and (max-width: 996px) { + .docTitle { + font-size: 2rem; + margin-bottom: 2rem; + } +} + .docItemContainer { margin: 0 auto; max-width: 45em; diff --git a/packages/docusaurus-theme-classic/src/theme/DocLegacyPage/index.js b/packages/docusaurus-theme-classic/src/theme/DocLegacyPage/index.js index 0d0eac1cfb..16ebad3041 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocLegacyPage/index.js +++ b/packages/docusaurus-theme-classic/src/theme/DocLegacyPage/index.js @@ -13,29 +13,28 @@ import Layout from '@theme/Layout'; import DocLegacySidebar from '@theme/DocLegacySidebar'; import MDXComponents from '@theme/MDXComponents'; +import styles from './styles.module.css'; + function DocLegacyPage(props) { const {route, docsMetadata, location} = props; const {permalinkToSidebar, docsSidebars} = docsMetadata; - const sidebar = - permalinkToSidebar[location.pathname] || - permalinkToSidebar[location.pathname.replace(/\/$/, '')]; + const sidebar = permalinkToSidebar[location.pathname.replace(/\/$/, '')]; + return ( -
-
-
- -
-
- - {renderRoutes(route.routes)} - -
+
+
+
+
+ + {renderRoutes(route.routes)} + +
); diff --git a/packages/docusaurus-theme-classic/src/theme/DocLegacyPage/styles.module.css b/packages/docusaurus-theme-classic/src/theme/DocLegacyPage/styles.module.css new file mode 100644 index 0000000000..453432cb78 --- /dev/null +++ b/packages/docusaurus-theme-classic/src/theme/DocLegacyPage/styles.module.css @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +.docPage { + display: flex; +} + +.docSidebarContainer { + border-right: 1px solid var(--ifm-contents-border-color); + box-sizing: border-box; + width: 300px; +} + +.docMainContainer { + flex-grow: 1; +} + +@media (max-width: 996px) { + .docPage { + display: inherit; + } +} diff --git a/packages/docusaurus-theme-classic/src/theme/DocLegacySidebar/index.js b/packages/docusaurus-theme-classic/src/theme/DocLegacySidebar/index.js index b8adfe78d1..fe5fe9fb1f 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocLegacySidebar/index.js +++ b/packages/docusaurus-theme-classic/src/theme/DocLegacySidebar/index.js @@ -104,7 +104,9 @@ function DocLegacySidebar(props) { const sidebarData = docsSidebars[currentSidebar]; if (!sidebarData) { - throw new Error(`Can not find ${currentSidebar} config`); + throw new Error( + `Cannot find the sidebar "${currentSidebar}" in the sidebar config!`, + ); } sidebarData.forEach(sidebarItem => diff --git a/packages/docusaurus-theme-classic/src/theme/DocLegacySidebar/styles.module.css b/packages/docusaurus-theme-classic/src/theme/DocLegacySidebar/styles.module.css index 13fb96ac2b..f39d45fdbe 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocLegacySidebar/styles.module.css +++ b/packages/docusaurus-theme-classic/src/theme/DocLegacySidebar/styles.module.css @@ -15,10 +15,6 @@ } } -.sidebar { - border-right: 1px solid var(--ifm-contents-border-color); -} - .sidebarMenuIcon { vertical-align: middle; }