-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sidebar Navigation for Reference Pages #50
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good case for a unit test on getNavFromEdges
.
And I'm running into what might just call for a readme documentation in this project along the lines of "how to manage paths." I notice the presence of an /a/b
path value keeps an /a/b/c
path value from showing up as A => B => C in the nav even if an /a/b/index is present. I think writing out at least a draft documentation for this now will help solidify that this is feeling right.
Totally agree about the tests and about the documentation. Also, it turns out that Gatsby doesn't treat paths that end with Probably something best done after we have some tests defining how we want it to function. |
I've updated this PR to include a test to ensure that the utility function is running correctly. This also helped me refactor the link generation to resolve how we were creating "index" pages. Ready for a re-review! |
Awesome work on this. Is the intention for this PR to support the following? path 1: /a I don't want to go overkill in testing/reviewing this if the existing test case in the test file is all we need at this moment for initial content creation. |
@timglaser I believe that this test covers all of those scenarios. I'm happy to add more tests if we would like...was just trying to keep this moving. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔗
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Descriptions
Updates the reference page template to query GraphQL for markdown files. Once we have the data from Gatsby, we convert it to a format that our UI can use to build out a nested set of links.
The heavy lifting for this work is done in
src/utils/nav-from-edges.js
, so I added a bunch of documentation explaining what's going on. I also added a couple dummy markdown pages to help test that everything is working.Note: in the future we should update the GraphQL query to only get files using the reference template (this gets all markdown files for now). Also, we are simply sorting alphabetically by
displayName
at the moment.Preview Link(s)
Related Ticket(s)
Screenshot(s)