Skip to content

Commit

Permalink
Add Root component for app-wide context and stateful logic; Improve m…
Browse files Browse the repository at this point in the history
…ax width for example page templates; List examples at root level of site menu instead of under a dropdown
  • Loading branch information
eliot-akira committed Oct 8, 2024
1 parent 2d9003a commit 2d074a7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
21 changes: 11 additions & 10 deletions docs/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,17 @@ const sidebars: SidebarsConfig = {
'content',
'layout',
'utilities',
{ type: 'html', value: `<hr>`},
{
type: 'category',
label: 'Examples',
link: {
type: 'generated-index',
title: 'Examples',
},
items: [{ type: 'autogenerated', dirName: 'examples' }]
},
{ type: 'html', value: `<hr><b style="margin-left:.75rem;">Examples</b>`},
{ type: 'autogenerated', dirName: 'examples' },
// {
// type: 'category',
// label: 'Examples',
// link: {
// type: 'generated-index',
// title: 'Examples',
// },
// items: [{ type: 'autogenerated', dirName: 'examples' }]
// },
],
}

Expand Down
7 changes: 7 additions & 0 deletions docs/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,10 @@ $data-theme-prefix: '';
--ifm-footer-background-color: #242526; // #303846
}
}

// Give content more width when no sidebar
@media (min-width: 997px) {
#__docusaurus .docItemCol_node_modules-\@docusaurus-theme-classic-lib-theme-DocItem-Layout-styles-module {
max-width: 100% !important;
}
}
12 changes: 12 additions & 0 deletions src/theme/Root.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react'

/**
* Add stateful logic that is not re-initialized across navigations
* @see https://docusaurus.io/docs/next/swizzling#wrapper-your-site-with-root
*/
export default function Root({ children }) {

// TODO: React Context provider

return <>{children}</>
}

0 comments on commit 2d074a7

Please sign in to comment.