-
Notifications
You must be signed in to change notification settings - Fork 44
Sidebar generator #165
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 generator #165
Conversation
✔️ Deploy Preview for pensive-meitner-faaeee ready! 🔨 Explore the source changes: 25d09f5 🔍 Inspect the deploy log: https://app.netlify.com/sites/pensive-meitner-faaeee/deploys/61fc6e78abe9cb0007f2c1e8 😎 Browse the preview: https://deploy-preview-165--pensive-meitner-faaeee.netlify.app |
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 looks great! The only thing we should do is to add a small section to the main README to point this new feature out.
Indeed! That's in the AC, in fact, but I forgot to include it. I'll push another commit, hopefully later today. |
I've pushed a new README section (and some other minor changes to it), as well as a few additions and fixes in the tests. |
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.
LGTM!
The names of the sidebars that get exported from each sidebar.js file aren't actually relevant, moreover many of them were copy pasted and used the wrong name. This changes them to the generic "sidebar" or "sidebars" (for multi-sidebar files) for consistency.
Our deployment guides initially used auto-generated sidebars. Now that we're leveraging the sidebar files, these are no longer needed.
8c36734
to
810102c
Compare
scripts/sidebar-lib.js
Outdated
|
||
for (const fullPath of fullPaths) { | ||
if (fs.statSync(fullPath).isDirectory()) { | ||
// process subdirectories recusively (back button is top level only!) |
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.
I had already called this out explicitly, and yet somehow forgot to omit it in the opts the first time around.
810102c
to
25d09f5
Compare
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.
LGTM!
Adds a new script, run via
yarn sidebar
, capable of generating sidebar.js files for any direcory (or directories) in_docs-sources
(or in the outputdocs
directory). It includes support for the category index convention, and supports adding an optional back button. Tests included.