diff --git a/gatsby-node.js b/gatsby-node.js index dab0520d6..7e299b7d6 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -49,6 +49,9 @@ exports.createPages = async ({ actions, graphql, reporter }) => { component: path.resolve(`src/templates/${frontmatter.template}.js`), context: { fileRelativePath: getFileRelativePath(node.fileAbsolutePath), + pageType: + frontmatter.template[0].toLowerCase() + + frontmatter.template.replace('Template', '').slice(1), guidesFilter: frontmatter.template === 'OverviewTemplate' ? `${frontmatter.path}/*` diff --git a/src/layouts/MainLayout.js b/src/layouts/MainLayout.js index 31ee4f330..1e9f90289 100644 --- a/src/layouts/MainLayout.js +++ b/src/layouts/MainLayout.js @@ -17,6 +17,21 @@ import usePageContext from '../hooks/usePageContext'; const gaTrackingId = 'UA-3047412-33'; const gdprConsentCookieName = 'newrelic-gdpr-consent'; +const GRID_LAYOUTS = { + guide: css` + grid-template-areas: + 'sidebar content related-content' + 'sidebar footer footer'; + grid-template-columns: var(--sidebar-width) minmax(0, 1fr) 340px; + `, + default: css` + grid-template-areas: + 'sidebar content' + 'sidebar footer'; + grid-template-columns: var(--sidebar-width) minmax(0, 1fr); + `, +}; + const MainLayout = ({ children }) => { const { site: { layout, siteMetadata }, @@ -34,7 +49,7 @@ const MainLayout = ({ children }) => { } `); - const { fileRelativePath } = usePageContext(); + const { fileRelativePath, pageType } = usePageContext(); const [cookieConsent, setCookieConsent] = useState(false); const [isMobileNavOpen, setIsMobileNavOpen] = useState(false); const isComponentDoc = fileRelativePath.includes( @@ -87,15 +102,13 @@ const MainLayout = ({ children }) => {
{ > {children} - + {pageType === 'guide' && ( + + )}