diff --git a/gatsby-node.js b/gatsby-node.js index 46ae2418..1a765c90 100755 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -132,12 +132,13 @@ exports.createPages = ({ graphql, actions }) => { await createSwaggerPages(createPage) // API: ocean.js - const lastRelease = result.data.oceanJs.repository.releases.edges.filter( - ({ node }) => - !node.isPrerelease && - !node.isDraft && - node.releaseAssets.edges.length > 0 - )[0].node.releaseAssets.edges[0].node + const lastRelease = + result.data.oceanJs.repository.releases.edges.filter( + ({ node }) => + !node.isPrerelease && + !node.isDraft && + node.releaseAssets.edges.length > 0 + )[0].node.releaseAssets.edges[0].node await createTypeDocPage( createPage, diff --git a/src/components/Sidebar.jsx b/src/components/Sidebar.jsx index 7c6cd4a8..62d26cb9 100644 --- a/src/components/Sidebar.jsx +++ b/src/components/Sidebar.jsx @@ -122,7 +122,10 @@ export default class Sidebar extends Component { {sidebarfile.map((group, i) => (
{collapsed ? ( - group.items.some((item) => location.pathname.startsWith(item.link)) ? ( + group.items.some( + (item) => + location.pathname.substring(0, item.link.length) === item.link + ) ? ( { const className = - selectedModule.id === id ? moduleStyles.active : moduleStyles.link + selectedModule.id === id ? sidebarStyles.active : sidebarStyles.link return (
  • @@ -94,7 +93,6 @@ export default function MarkdownList({ data, location, pageContext }) { toc={nestedSidebarList} > - ) @@ -102,21 +100,20 @@ export default function MarkdownList({ data, location, pageContext }) { MarkdownList.propTypes = { pageContext: PropTypes.object.isRequired, - location: PropTypes.object.isRequired + location: PropTypes.object.isRequired, + data: PropTypes.object } - export const MarkdownListQuery = graphql` - query { - allSectionsYaml { - edges { + query { + allSectionsYaml { + edges { node { - title + title description - link + link } } } } - ` - +`