+
+ {staticToc.map((navItems) => {
+ return ;
+ })}
+
+
+ {unifiedTocTree.map((navItems) => {
+ if (`${navItems.url}/` === activeTab) {
+ return ;
+ }
+ return null;
+ })}
+
+
+ >
+ );
+}
diff --git a/src/hooks/use-unified-toc.js b/src/hooks/use-unified-toc.js
new file mode 100644
index 000000000..02a9cc53e
--- /dev/null
+++ b/src/hooks/use-unified-toc.js
@@ -0,0 +1,15 @@
+const { useStaticQuery, graphql } = require('gatsby');
+
+export function useUnifiedToc() {
+ const data = useStaticQuery(
+ graphql`
+ query TocTree {
+ toc {
+ id
+ tocTree
+ }
+ }
+ `
+ );
+ return data.toc.tocTree.toc ?? {};
+}
diff --git a/src/layouts/index.js b/src/layouts/index.js
index 1e83b5df8..b41fd45ed 100644
--- a/src/layouts/index.js
+++ b/src/layouts/index.js
@@ -13,6 +13,8 @@ import { theme } from '../theme/docsTheme';
import useSnootyMetadata from '../utils/use-snooty-metadata';
import { useRemoteMetadata } from '../hooks/use-remote-metadata';
import { getAllLocaleCssStrings } from '../utils/locale';
+import { UnifiedSidenav } from '../components/UnifiedSidenav/UnifiedSidenav';
+import { getFeatureFlags } from '../utils/feature-flags';
// TODO: Delete this as a part of the css cleanup
// Currently used to preserve behavior and stop legacy css
@@ -94,6 +96,7 @@ export const StyledContentContainer = styled('div')`
const DefaultLayout = ({ children, data: { page }, pageContext: { slug, repoBranches, template } }) => {
const { sidenav } = getTemplate(template);
const { chapters, guides, slugToTitle, toctree, eol, project } = useSnootyMetadata();
+ const { isUnifiedToc } = getFeatureFlags();
const remoteMetadata = useRemoteMetadata();
const isInPresentationMode = usePresentationMode()?.toLocaleLowerCase() === 'true';
@@ -115,7 +118,9 @@ const DefaultLayout = ({ children, data: { page }, pageContext: { slug, repoBran
>